Estudo teste
,F d ls n ro + a nt DI
Co s, G u en
M
.NET
WINDOWS FORMS
IN A NUTSHELL
A Desktop Quick Reference
Ian Griffiths & Matthew Adams
.NET WINDOWS FORMS
IN A NUTSHELL
Ian Griffiths and Matthew Adams
Beijing • Cambridge • Farnham • Köln • Paris • Sebastopol • Taipei • Tokyo
Chapter 1
Table of Contents
Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ix
Part I. Introduction to Windows Forms
1. .NET and Windows Forms Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Windows Development and .NET
The Common Language Runtime (CLR)
.NET Programming Languages
Components
The .NET Type System
3
5
10
11
12
2. Controls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
Windows Forms and the Control Class
Using Standard Control Features
Built-in Controls
23
24
47
3. Forms, Containers and Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
Application Structure
The Form Class
Containment
Layout
Localization
Extender Providers
Summary
51
56
68
76
81
86
87
v
This is the Title of the Book, eMatter Edition
Copyright © 2002 O’Reilly & Associates, Inc. All rights reserved.
4. Menus and Toolbars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
Menus
88
5. Building Controls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
Composite Controls
Custom Controls
Designing for Developers
Summary
95
100
112
116
6. Inheritance and Reuse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
When To Inherit
Inheriting from Forms and User Controls
Inheriting from Other Controls
Pitfalls of Inheritance
Summary
119
122
127
136
140
7. Redrawing and GDI+ . . . . . . . . . . . . . . . . . . . . . . . . . . .