did-you-know? rent-now

Amazon no longer offers textbook rentals. We do!

did-you-know? rent-now

Amazon no longer offers textbook rentals. We do!

We're the #1 textbook rental company. Let us show you why.

9780321267962

Windows Forms 2.0 Programming

by ;
  • ISBN13:

    9780321267962

  • ISBN10:

    0321267966

  • Edition: 2nd
  • Format: Paperback
  • Copyright: 2006-05-16
  • Publisher: Addison-Wesley Professional

Note: Supplemental materials are not guaranteed with Rental or Used book purchases.

Purchase Benefits

  • Free Shipping Icon Free Shipping On Orders Over $35!
    Your order must be $35 or more to qualify for free economy shipping. Bulk sales, PO's, Marketplace items, eBooks and apparel do not qualify for this offer.
  • eCampus.com Logo Get Rewarded for Ordering Your Textbooks! Enroll Now
  • Complimentary 7-Day eTextbook Access - Read more
    When you rent or buy this book, you will receive complimentary 7-day online access to the eTextbook version from your PC, Mac, tablet, or smartphone. Feature not included on Marketplace Items.
List Price: $69.99 Save up to $29.05
  • Rent Book $40.94
    Add to Cart Free Shipping Icon Free Shipping

    TERM
    PRICE
    DUE

    7-Day eTextbook Access 7-Day eTextbook Access

    USUALLY SHIPS IN 24-48 HOURS
    *This item is part of an exclusive publisher rental program and requires an additional convenience fee. This fee will be reflected in the shopping cart.

Supplemental Materials

What is included with this book?

Summary

Striking a balance between theory and practice, Microsoft guru Chris Sells has revised the definitive book on WinForms for WinForms 2.0

Author Biography

Chris Sells is a program manager for the Connected Systems Division. He’s written several books, including Programming Windows Presentation Foundation (O’Reilly), Windows Forms Programming in C# (Addison-Wesley), and ATL Internals (Addison-Wesley). In his free time, Chris hosts various conferences and makes a pest of himself on Microsoft internal product team discussion lists. More information about Chris–and his various projects–is available at www.sellsbrothers.com.

 

Michael Weinhardt is a programmer/writer at Microsoft, working on the Windows Client SDK. Michael has coauthored a variety of articles with Chris, contributed to the “Wonders of Windows Forms” column at MSDN Online, reviewed several Windows technology books, and generally loves communicating the whys and wherefores of technology to his peers. Michael is sure that his parents attribute his fascination in technology to their purchase of an Amiga 1000 in the mid-80s. They would be right.

 

Table of Contents

About the Authors xxv
Foreword xxvii
Preface xxxi
Hello, Windows Forms
1(40)
Windows Forms from Scratch
1(6)
Windows Forms in Visual Studio .NET
7(6)
Arranging Controls
13(3)
Controls
16(3)
Application Settings
19(4)
Resources
23(4)
Dialogs
27(3)
Drawing
30(2)
Printing
32(1)
Data Binding
33(3)
Multithreaded User Interfaces
36(2)
Deployment
38(1)
Where Are We?
39(2)
Forms
41(58)
Showing Forms
41(4)
Owner and Owned Forms
42(3)
Form Lifetime
45(6)
Form Opening
46(2)
Form Deactivation and Reactivation
48(1)
Form Closing
49(2)
Form Notification
51(6)
Flashing Notification
51(1)
System Tray Notification
52(2)
System Tray-Only Applications
54(3)
Form Size and Location
57(7)
Restricting Form Size
62(1)
Form Z-Order
63(1)
Form Adornments
64(1)
Form Transparency
65(5)
Nonrectangular Forms
67(3)
Form and Context Menus
70(8)
Context Menus
76(2)
Tool Strips
78(2)
Status Strips
80(3)
Multiple Document Interface Applications
83(12)
Visual Inheritance
95(3)
Where Are We?
98(1)
Dialogs
99(38)
Standard Dialogs
100(1)
Form Styles
101(2)
Deciding on Modal Versus Modeless at Run-Time
103(1)
Data Exchange
103(7)
Handling OK and Cancel
104(5)
Modeless Form Data
109(1)
Data Validation
110(10)
Regular Expressions and Validation
111(2)
Masked Text Entry and Validation
113(1)
Data Format Notification
114(1)
Combined Validation
115(1)
Thorough Validation
116(4)
Implementing Help
120(13)
Tool Tips
121(1)
Using ErrorProvider for General Information
121(3)
Handling the Help Button and F1
124(2)
Using HTML Help
126(2)
Compiled HTML Help
128(4)
Using the HelpProvider Component
132(1)
Showing Help Contents, Index, and Search
133(1)
Where Are We?
133(4)
Layout
137(42)
Fixed Layout
137(8)
Position and Size
137(5)
Control Z-Order
142(2)
Control Tab Order
144(1)
Dynamic Layout
145(21)
Anchoring
145(4)
Docking
149(1)
Docking and Z-Order
150(3)
Docking with Tool Strip Controls
153(8)
Automatic Resizing
161(2)
Automatic Scaling
163(3)
Layout Controls
166(10)
Splitting
167(1)
Grouping
168(2)
Flow Layout
170(3)
TableLayoutPanel
173(3)
Layout Optimization
176(1)
Custom Layout
176(1)
Where Are We?
177(2)
Drawing Basics
179(52)
Drawing to the Screen
180(4)
Handling the Paint Event
181(1)
Triggering the Paint Event
182(2)
Colors
184(4)
Known Colors
185(3)
Color Translation
188(1)
Brushes
188(8)
Solid Brushes
189(1)
Texture Brushes
189(1)
Hatch Brushes
190(1)
Linear Gradient Brushes
191(2)
Path Gradient Brushes
193(3)
Pens
196(7)
Line Caps
197(2)
Dashes
199(1)
Pen Alignment
200(1)
Joins
200(2)
Creating Pens from Brushes
202(1)
Shapes
203(4)
Curves
203(2)
Smoothing Modes
205(1)
Saving and Restoring Graphics Settings
205(2)
Paths
207(3)
Fill Modes
209(1)
Images
210(19)
Loading and Drawing Images
211(1)
Scaling, Clipping, Panning, and Skewing
212(2)
Rotating and Flipping
214(1)
Recoloring
215(1)
Transparency
216(1)
Animation
217(3)
Drawing to Images
220(2)
Screen Copying
222(1)
Icons
223(2)
Cursors
225(4)
Where Are We?
229(2)
Drawing Text
231(34)
Fonts
231(11)
Creating Fonts
233(1)
Font Families
234(2)
System Fonts
236(2)
Font Characteristics
238(2)
Font Height
240(2)
Strings
242(9)
Formatting
242(8)
Strings and Paths
250(1)
The TextRenderer
251(4)
Formatting with TextRenderer
253(2)
A Tale of Two Technologies
255(9)
Shell Consistency
256(1)
Internationalization
257(1)
Device-Independent Drawing
258(2)
Font Edge Smoothing Support
260(1)
Performance
261(1)
Integration with GDI+ Graphical Rendering
261(1)
Text-Formatting Comparison
261(2)
Integration
263(1)
Where Are We?
264(1)
Advanced Drawing
265(26)
Page Units
265(4)
Converting Pixels to Page Units
268(1)
Transforms
269(11)
Scaling
270(1)
Scaling Fonts
271(1)
Rotation
272(2)
Translation
274(1)
Shearing
275(1)
Combining Transforms
276(1)
Transformation Helpers
277(1)
Path Transformations
278(2)
Regions
280(3)
Constructing and Filling a Region
280(1)
Clipping to a Region
281(1)
Region Combination Operations
282(1)
Optimized Drawing
283(7)
Double Buffering
284(2)
Manual Double Buffering
286(3)
Double Buffering Performance Considerations
289(1)
Other Drawing Options
289(1)
Where Are We?
290(1)
Printing
291(36)
Print Documents
291(2)
Print Controllers
293(5)
Print Preview
294(3)
PrintPreviewDialog Control Box Icon
297(1)
Basic Print Events
298(3)
Margins
301(4)
Page Settings
305(3)
Printer Settings
308(7)
Print Range
310(4)
Targeting the Printer
314(1)
Useful Printing Techniques
315(10)
Word Wrapping and Pagination
316(4)
Per-Page Page Setting Configuration
320(2)
Dynamic Page Counting
322(3)
Where Are We?
325(2)
Components
327(26)
Components Defined
327(1)
Using Components
328(4)
Creating Custom Components
332(19)
Deriving Directly from System ComponentModel.Component
332(2)
Component Resource Management
334(3)
Implementing IComponent
337(6)
Adding a Custom Component to the Toolbox
343(1)
Custom Functionality
344(5)
Extending Existing Components
349(2)
Where Are We?
351(2)
Controls
353(46)
Controls Defined
353(1)
Using Controls
354(2)
Themed Controls
356(6)
Tool Strip Render Modes
358(4)
Owner-Drawn Controls
362(7)
ControlPaint
365(3)
Themed Control Rendering
368(1)
Extending Existing Controls
369(2)
Custom Controls
371(22)
Deriving Directly from System.Windows.Forms.Control
371(2)
Control Rendering
373(1)
Custom Implementation
374(3)
EventChanged
377(2)
Ambient Properties
379(4)
Control Input
383(6)
Scrolling
389(3)
Windows Message Handling
392(1)
User Controls
393(4)
Testing User Controls
395(2)
Hosting COM Controls
397(1)
Where Are We?
398(1)
Design-Time Integration: The Properties Window
399(54)
Design-Time Components
399(1)
Hosts, Containers, and Sites
400(3)
Debugging Design-Time Functionality
403(2)
The DesignMode Property
405(1)
Attributes
405(8)
Changing the Toolbox Icon
406(1)
Properties Window Integration
407(6)
Code Serialization
413(2)
Batch Initialization
415(6)
ISupportInitializeNotification
419(2)
Extender Property Providers
421(7)
Type Converters
428(14)
Custom Type Converters
431(5)
Expandable Object Converter
436(3)
Custom Type Code Serialization with TypeConverters
439(3)
UI Type Editors
442(9)
Drop-Down UI Type Editors
445(3)
Modal UI Type Editors
448(3)
Where Are We?
451(2)
Design-Time Integration: Designers and Smart Tags
453(52)
Designers
453(12)
ComponentDesigner
455(4)
ControlDesigner
459(3)
Design-Time-Only Properties
462(3)
Smart Tags
465(38)
Designer Actions
466(1)
Designer Action Lists
467(11)
Smart Tag Properties
478(1)
Smart Tag Method Items
478(3)
Poor Man's Smart Tag Panel Appearance
481(3)
Custom Smart Tag Panel Appearance
484(9)
Adding a Smart Tag Method Item to the Context Menu
493(1)
Toggling the Label Text of a Smart Tag Item
494(4)
Designer Action Lists
498(1)
Dynamic Designer Actions
499(4)
Where Are We?
503(2)
Resources
505(44)
Resource Basics
505(6)
Manifest Resources
506(5)
Strongly Typed Resources
511(19)
Application Resources (.resx) Files
511(2)
Managing Resources
513(3)
Resource Persistence
516(2)
Using Typed Resources
518(2)
The Resource Manager
520(2)
Strongly Typed Resource Classes
522(4)
Designer Resources
526(4)
Embedding Native Resources
530(1)
Application Internationalization
530(17)
Culture Information
532(1)
Resource Localization
533(4)
Resource Localization for Nondevelopers
537(3)
Resource Probing
540(2)
Resource Resolution
542(1)
Input Language
543(2)
Reading Direction
545(2)
Where Are We?
547(2)
Applications
549(30)
Applications
549(11)
Application Lifetime
551(1)
Application Context
552(3)
Application Events
555(1)
UI Thread Exceptions
555(4)
Passing Command Line Arguments
559(1)
Single-Instance Applications
560(17)
Single-Instance Detection and Management
560(3)
Multiple-SDI Applications
563(9)
Single-MDI Applications
572(5)
Where Are We?
577(2)
Settings
579(50)
The Application Environment
579(10)
Compile-Time Settings
579(3)
Run-Time Settings
582(7)
Application, User, and Roaming-User Settings
589(15)
What Is a Setting?
590(1)
Settings Files
590(1)
Managing Settings
591(1)
Editing Settings
592(3)
Application Configuration Files
595(3)
The Configuration Manager
598(3)
User Configuration Files
601(3)
Strongly Typed Settings
604(2)
Using Strongly Typed Settings
606(11)
Using the Settings Class
606(1)
Loading and Inspecting Settings
607(2)
Updating Settings
609(2)
Saving Settings
611(1)
Rolling Back Settings
611(2)
Migrating Settings
613(4)
Designer Settings
617(8)
Properties Window Configuration
617(1)
Property Binding
618(4)
Persisting Form State, Size, and Position
622(1)
Support for Automatic Tool Strip Layout
623(2)
Alternative Storage for Settings
625(3)
The Registry
625(2)
Special Folders
627(1)
Where Are We?
628(1)
Data Binding Basics
629(52)
The Land before Data Binding
629(5)
Simple Data Binding and Item Data Sources
634(2)
Simple Binding and List Data Sources
636(6)
Complex Binding and List Data Sources
642(3)
IBindingList
645(2)
BindingList<T>
647(4)
Two-Way List Change Synchronization
648(2)
Two-Way Item Change Synchronization
650(1)
The BindingSource Component
651(3)
Turning an Item Type into a List Data Source
651(2)
Using BindingSource at Design Time
653(1)
Design-Time Data Sources
654(14)
Databases
655(4)
Web Services
659(2)
Objects
661(3)
Configuring the BindingSource
664(3)
Data Source Persistence
667(1)
Binding UI Elements in the Designer
668(12)
BindingSource as a Bindable List Data Source
668(12)
Where Are We?
680(1)
Applied Data Binding
681(56)
Drag-and-Drop Data Binding
681(4)
DataGridView Bound Uls
682(2)
Details Bound Uls
684(1)
Fundamentals of Data-Bound Uls
685(26)
Item Uls
685(15)
List Uls
700(11)
Data Views
711(5)
Real-World Data-Bound Uls
716(20)
Master-Details Uls
717(5)
List-Item UIs
722(6)
Hierarchical Uls
728(2)
Multiple Data Contexts
730(2)
TypeConverters
732(4)
Where Are We?
736(1)
Multithreaded User Interfaces
737(38)
Long-Running Operations
737(29)
Progress Indication
737(3)
Asynchronous Operations
740(3)
Safety and Multithreading
743(7)
Simplified Multithreading
750(2)
Reporting Progress
752(11)
Shared Data
763(3)
Asynchronous Web Services
766(8)
Web Service Components
771(3)
Where Are We?
774(1)
ClickOnce Deployment
775(54)
A Day in the Life of ClickOnce Deployment
776(9)
Publishing an Application
777(5)
Launching an Application
782(3)
ClickOnce Configuration
785(13)
Bootstrapping
786(3)
Application Files
789(1)
Publisher Details
790(3)
Install Mode
793(1)
Versioning
794(4)
ClickOnce Security
798(16)
Code Signing
798(10)
Code Access Security
808(6)
Managing Permissions
814(3)
Determining Required Permissions
814(2)
Ascertaining Required Permissions
816(1)
Considerations for Partially Trusted Assemblies
817(8)
Gathering Assembly Information
817(2)
Handling Keystrokes
819(1)
Communicating via Web Services
819(4)
Reading and Writing Files
823(1)
Handling Multiple Partial Trust Deployment Zones
823(2)
Debugging Partially Trusted Applications
825(1)
Processing Command Line Arguments
825(3)
Where Are We?
828(1)
Appendix A What's New in Windows Forms 2.0
829(16)
A Few Words About Windows Forms
829(1)
Windows Forms 2.0 Enhancements
830(2)
Windows Forms 2.0: The Improvements
832(13)
Forms
832(2)
Drawing
834(1)
Printing
835(1)
Components and Controls
835(2)
Design-Time Integration
837(1)
Resources
838(1)
Applications
839(1)
Settings
839(1)
Data Binding
840(2)
Multithreaded User Interfaces
842(1)
ClickOnce Deployment
843(2)
Appendix B Moving from MFC
845(22)
A Few Words About MFC
845(2)
MFC Versus Windows Forms
847(9)
The Differences
849(6)
Strategy
855(1)
MFC and Windows Forms Interop
856(7)
Hosting MFC COM Controls in Windows Forms
856(3)
Hosting Windows Forms Controls in MFC
859(4)
Windows Forms as a Better MFC
863(4)
Appendix C Delegates and Events
867(14)
Delegates
867(5)
Interfaces
868(1)
Delegates
869(2)
Static Listeners
871(1)
Events
872(4)
Harvesting All Results
873(1)
Asynchronous Notification: Fire and Forget
873(1)
Asynchronous Notification: Polling
874(1)
Asynchronous Notification: Delegates
875(1)
Anonymous Delegates
876(1)
Happiness in the Universe
877(4)
Appendix D Component and Control Survey
881(20)
Components
881(3)
BackgroundWorker
881(1)
BindingNavigator
881(1)
BindingSource
881(1)
ColorDialog
881(1)
ErrorProvider
882(1)
FolderBrowserDialog
882(1)
FontDialog
882(1)
HelpProvider
882(1)
ImageList
882(1)
NotifyIcon
883(1)
OpenFileDialog
883(1)
PageSetupDialog
883(1)
PrintDialog
883(1)
PrintDocument
883(1)
PrintPreviewDialog
884(1)
SaveFileDialog
884(1)
SoundPlayer
884(1)
Timer
884(1)
Tool Tip
884(1)
Controls
884(17)
Button
885(1)
CheckBox
886
CheckedListBox
885(1)
ComboBox
886(1)
ContextMenuStrip
887(1)
DataGridView
887(1)
DateTimePicker
887(1)
DomainUpDown
888(1)
FlowLayoutPanel
888(1)
GroupBox
888(1)
HScrollBar
888(1)
Label
889(1)
LinkLabel
889(1)
ListBox
890(1)
ListView
891(1)
MaskedTextBox
892(1)
MenuStrip
893(1)
MonthCalendar
893(1)
NumericUpDown
893(1)
Panel
894(1)
PictureBox
894(1)
PrintPreviewControl
894(1)
ProgressBar
894(1)
RadioButton
895(1)
RichTextBox
896(1)
SplitContainer
896(1)
StatusStrip
896(1)
TabControl
896(1)
TableLayoutPanel
896(1)
TextBox
896(1)
ToolStrip
897(1)
ToolStripContainer
897(1)
TrackBar
897(1)
TreeView
897(1)
VScrollBar
898(1)
WebBrowser
899(2)
Appendix E Drag and Drop
901(26)
Enabling Drag and Drop
901(7)
The Drag Source
901(1)
The Drop Target
902(3)
Drop Targets and COM
905(1)
Drag and Drop in Operation
906(2)
Adding Support for Multiple Drag-and-Drop Effects
908(3)
Adding Multiple Drag-and-Drop Effects to the Drag Source
908(1)
Adding Multiple Drag-and-Drop Effects to the Drop Target
908(3)
Customizing Drag and Drop
911(3)
Using Custom Cursors
911(2)
Controlling Drag-and-Drop Completion
913(1)
Drag and Drop of Multiple Data Items
914(11)
Dragging Multiple ListView Items
914(1)
Pieces of an Explorer-Style UI
915(4)
Initiating a Drag Operation
919(1)
Drag in Action
920(3)
Completing a Drag Operation
923(2)
File Drag and Drop
925(2)
Appendix F Document Management
927(30)
The FileDocument Component
931(9)
Dirty Bit Management
932(1)
File Management
933(2)
Handling the File Menu Items
935(2)
MDI and the FileDocument Component
937(3)
Shell Integration
940(5)
Integrating with the Shell
940(2)
Document Icons
942(2)
Start I Documents
944(1)
The MruMenuManager Component
945(9)
Getting an MRU Menu
946(1)
Configuring the MRU Menu Appearance
947(2)
Adding a File to the MRU Menu
949(1)
Opening an MRU File
950(1)
Persisting the MRU Menu across Application Sessions
951(1)
MruMenuManager and MDI Applications
952(2)
Opening Files Dragged and Dropped from the Shell
954(3)
Bibliography 957(4)
Index 961

Supplemental Materials

What is included with this book?

The New copy of this book will include any supplemental materials advertised. Please check the title of the book to determine if it should include any access cards, study guides, lab manuals, CDs, etc.

The Used, Rental and eBook copies of this book are not guaranteed to include any supplemental materials. Typically, only the book itself is included. This is true even if the title states it includes any access cards, study guides, lab manuals, CDs, etc.

Excerpts

PrefaceWindows 1.0 programmers had a straightforward life. They had almost no choices about how to do things; either there was an application programming interface (API), or there wasnrs"t, and most of the time there wasnrs"t. This meant that developers had to build almost everything by hand. At the time, this wasnrs"t a problem. All Windows programmers had the same limitations, so everyoners"s apps more or less operated with the same limited set of functionality.A modern Windows developer, on the other hand, is inundated with choices. The invention of the web alone gives us static Hypertext Markup Language (HTML), server-based user interface (UI) interaction via ASP.NET, and client-side UI interaction via ActiveX controls or AJAX (to name a few). 1 On the client side, we have native frameworks like Microsoft Foundation Classes (MFC), Active Template Library (ATL), and the next-generation managed framework known as the Windows Presentation Foundation (WPF is part of WinFX, the follow-on to the .NET Framework). How does a developer choose? Where does Windows Forms 2.0, the topic of this book, fit into this pantheon?1 AJAX stands for Asynchronous JavaScript and XML, as defined by Jesse James Garrett, "Ajax: A New Approach to Web Applications," http://www.adaptivepath.com/publications/essays/archives/000385.php ( http://tinysells.com/38 ).Client technologies on Windows provide a range of reach and richness in inverse proportion to each other. Reach is the ability of a user interface (UI) to work across operating systems, whereas richness is the ability for a UI to take advantage of the operating system on which it runs. So even though static HTML works almost everywhere, to the extent that your HTML uses client-side JScript, reach is diminished for browsers that donrs"t support the scripting constructs being used. Even further down the reach scale are ActiveX controls, which work only on Windows but allow full access to its richness. 22 At one point, the Component Object Model (COM) and ActiveX were made to work across platforms, but they have long since been relegated to Windows only.At the other extreme we have WPF, a completely new managed framework built on top of DirectX. WPF encompasses documents, layout, animation, 2-D, 3-D, text, and graphics primitives in a single, cohesive whole. This framework provides the richest client technology that Microsoft has ever built, and it takes maximum advantage of the platform on which it runs, including any hardware 3-D graphics acceleration that may be available. However, at the time of this writing, WPF has not yet shipped and works only under Windows XP, Windows Server 2003, and Windows Vista. 33 WinFX (which inclues WPF) and Windows Vista are scheduled to ship in 2006.Where does that leave Windows Forms 2.0? It doesnrs"t quite offer the richness of WPF, but itrs"s far richer than the HTML-based technologies. Windows Forms 2.0 also is much richer than Windows Forms 1.0, with greatly enhanced support for flexible layout, modern menu strip and tool strip controls, data binding, multithreading, typed resources and settings, and, most importantly, ClickOnce deployment.With ClickOnce, for the first time, users can deploy Windows applications as easily as web applications. Even better, ClickOnce allows Windows applications to be installed locally, integrated with the Start menu, and accessed even if no network connection is available. These options are not available for users of Web applications.So Windows Forms 2.0 is high on the richness scale, but what about the reach scale? Unlike web applications, Wind

Rewards Program