Home Page Icon
Home Page
Table of Contents for
Programming .NET Windows Applications
Close
Programming .NET Windows Applications
by Dan Hurwitz, Jesse Liberty
Programming .NET Windows Applications
Programming .NET Windows Applications
A Note Regarding Supplemental Files
Copyright
Preface
About This Book
How the Book Is Organized
Who This Book Is for
Conventions Used in This Book
Version Support
Support: A Note From Jesse Liberty
We'd Like to Hear from You
Acknowledgments
1. Windows Forms and the .NET Framework
1.1. The .NET Framework
1.2. Windows Forms
1.2.1. Languages: C# and VB.NET
1.2.2. Visual Studio .NET
2. Getting Started
2.1. System Requirements
2.2. Hello World
2.2.1. Using a Text Editor
2.2.1.1. Hello World as a console application
2.2.1.2. Compiling the program
2.2.1.3. Hello World as a Windows application
2.2.1.4. Hello World Windows application with a button
2.2.2. Using Visual Studio .NET
2.2.2.1. Hello World as a console application
2.2.2.2. Hello World as a Windows application
2.2.2.3. Hello World Windows application with a button
3. Visual Studio .NET
3.1. Overview
3.2. Start Page
3.3. Projects and Solutions
3.3.1. Solutions
3.3.2. Projects
3.3.2.1. Templates
3.3.2.2. Project names
3.4. The Integrated Development Environment (IDE)
3.4.1. Layout
3.4.2. Menus and Toolbars
3.4.2.1. File menu
New...
Open...
Add New Item...(Ctrl+Shift+A)
Add Existing Item...(Shift+Alt+A)
Add Project
Open Solution
Close Solution
Advanced Save Options...
Source Control
3.4.2.2. Edit menu
Cycle Clipboard Ring (Ctrl+Shift+V)
Find and Replace → Find in Files (Ctrl+Shift+F)
Find and Replace → Replace in Files (Ctrl+Shift+H)
Find and Replace → Find Symbol (Alt+F12)
Go To...
Insert File As Text...
Advanced
Incremental search (Ctrl+I)
Bookmarks
Outlining
IntelliSense
3.4.2.3. View menu
Open/Open With...
Solution Explorer (Ctrl+Alt+L)
Properties Windows (F4)
Server Explorer (Ctrl+Alt+S)
Class View (Ctrl+Shift+C)
Other Windows
3.4.2.4. Project menu
Add... Menu Items
Exclude From Project
Add Reference...
Add Web Reference...
Set as StartUp Project
Project Dependencies... / Project Build Order...
3.4.2.5. Build menu
3.4.2.6. Debug menu
3.4.2.7. Data menu
3.4.2.8. Format menu
3.4.2.9. Tools menu
Connect to Device...
Connect to Database...
Connect to Server...
Add/Remove Toolbox Items...
Build Comment Web Pages...
Macros
External Tools...
Customize...
Options...
3.4.2.10. Window menu
3.4.2.11. Help menu
Dynamic Help (Ctrl+F1)
Contents... (Ctrl+Alt+F1)/Index... (Ctrl+Alt+F2)/Search... (Ctrl+Alt+F3)
Index Results... (Shift+Alt+F2)
Search Results... (Shift+Alt+F3)
Edit Filters...
Check for Updates
3.5. Building and Running
4. Events
4.1. Publish and Subscribe
4.1.1. Events and Delegates
4.1.2. Event Arguments
4.1.3. Control Events
4.1.4. Implementing an Event
4.1.4.1. In C#
Double-click the control
Use the lightning bolt icon in the Properties window
4.1.4.2. In VB.NET
Double-click the control
Use the drop-down lists at the top of the code window
Dynamic event implementation
4.2. Performance
4.3. Some Examples
4.3.1. Keyboard Events
4.3.2. TextBox Validation
5. Windows Forms
5.1. Web Applications Versus Windows Applications
5.2. The Forms Namespace
5.2.1. The Control Class
5.2.1.1. Ambient properties
5.2.1.2. The Control inheritance hierarchy
5.2.2. The Form Class
5.2.3. Component Classes
5.2.4. CommonDialog Classes
5.3. Form Properties
5.4. Forms Inheritance
5.4.1. Programmatic Inheritance
5.4.2. Visual Inheritance
5.5. User Interface Design
5.5.1. UI Principles
5.5.2. Interface Types
5.5.2.1. SDI
5.5.2.2. MDI
5.5.2.3. Tabbed interface
5.5.2.4. Explorer style
5.5.3. Input
5.5.3.1. Mouse input
5.5.3.2. Keyboard input
5.5.3.3. Keyboard shortcuts
6. Dialog Boxes
6.1. Modal Versus Modeless
6.2. Form Properties
6.3. DialogResult
6.4. Termination Buttons
6.5. Apply Button
6.6. CommonDialog Classes
6.6.1. FileDialog
6.6.1.1. OpenFileDialog
6.6.1.2. SaveFileDialog
6.6.2. ColorDialog
6.6.3. FontDialog
6.6.4. PageSetupDialog
6.6.5. PrintDialog
6.6.6. Print Preview Dialog
7. Controls: The Base Class
7.1. Control Class
7.1.1. Class Hierarchy
7.1.2. Common Features
7.1.2.1. Parent/child relationship
7.1.2.2. Z-order
7.1.2.3. Changing the z-order
7.1.2.4. Ambient properties
7.1.2.5. Font
7.1.2.6. Size and location
7.1.2.7. Dynamically setting size and location
Dynamically controlling size
Dynamically controlling location
7.1.2.8. AutoScale
7.1.2.9. Anchoring
7.1.2.10. Docking
7.1.2.11. Painting the control
7.1.2.12. Tag property
7.1.2.13. Tabbing
7.1.2.14. Keyboard interaction
Input focus
Navigation
7.1.2.15. ImageLists
8. Mouse Interaction
8.1. SystemInformation Properties
8.2. Mouse Events
8.2.1. Mouse Properties
9. Text and Fonts
9.1. Text
9.2. Fonts
9.2.1. Typographical Stuff
9.2.2. Font Class
9.2.2.1. Font properties
9.2.2.2. Constructors
9.2.2.2.1. Constructor based on existing font and FontStyles
9.2.2.2.2. Constructor based on FontFamily and size
9.2.2.2.3. Constructor based on FontFamily, size, and FontStyles
9.2.2.2.4. Constructor based on FontFamily, size, and GraphicsUnit
9.2.2.2.5. Constructor based on FontFamily, size, FontStyles, and GraphicsUnit
9.2.2.3. Line spacing
9.2.3. Drawing Strings
9.2.3.1. DrawString( )
9.2.3.2. Brush and brushes
9.2.3.3. Formatting and alignment
9.2.4. Measuring Strings
10. Drawing and GDI+
10.1. The Drawing Namespace
10.1.1. The Graphics Class
10.1.1.1. Coordinates
10.1.1.2. Transforms introduced
10.1.2. Graphics Methods
10.1.3. Obtaining a Graphics Object
10.1.4. Color Structure
10.1.5. Geometric Structures—Points, Rectangles, and Sizes
10.1.6. Brush and Brushes
10.1.7. Pen and Pens
10.1.8. Paint Event
10.1.8.1. Overriding the OnPaint method
10.1.8.2. Forcing a paint event—the Invalidate method
10.2. The Analog Clock Project
10.2.1. Drawing the Clock Face
10.2.1.1. Color
10.2.1.2. OnPaint
10.2.1.3. Transforming the coordinates
10.2.1.4. World transforms
10.2.2. Adding the Hands
10.2.2.1. Creating the timer
Implementing OnTimer
10.2.2.2. DrawTime method
10.2.2.3. Drawing the hands
Deleting the existing line
10.2.2.4. RotateTransform
10.2.2.5. FillElipse
10.2.2.6. Drawing the new time
10.2.2.7. Implementing the 24 hour clock button
10.2.3. Drawing the Animated Date
10.2.3.1. Animating the string
10.2.3.1.1. The LtrDraw class
10.2.3.1.2. The StringDraw class
10.2.3.1.3. New member variables
10.2.3.1.4. Modifying the constructor
10.2.3.2. Resetting the center
11. Labels and Buttons
11.1. Label
11.1.1. Using labels to provide access keys
11.1.2. LinkLabel
11.2. Button Classes
11.2.1. Button
11.2.1.1. DialogResult property
11.2.1.2. PerformClick method
11.2.1.3. Access keys
11.2.1.4. Form Button properties
11.2.2. CheckBox
11.2.3. RadioButton
12. Text Controls
12.1. Text
12.2. Editable Text Controls: TextBoxBase
12.2.1. Properties and Methods
12.2.2. Events
12.3. RichTextBox
12.3.1. RichTextBox Methods and Events
13. Other Basic Controls
13.1. Containers
13.2. Tabbed Pages
13.2.1. Tabbed Pages Using Visual Studio .NET
13.3. PictureBox
13.4. ScrollBar
13.4.1. As a Positioning Device
13.4.2. As a Parameter Adjuster
13.5. TrackBar
13.6. Up-Down Controls
13.6.1. NumericUpDown
13.6.2. DomainUpDown
13.7. ProgressBar
14. TreeView and ListView
14.1. Class Hierarchy
14.2. Splitter
14.2.1. Splitters in Visual Studio .NET
14.3. TreeView
14.3.1. Code Analysis
14.3.1.1. The constructor
14.3.1.2. Populating the Tree
14.3.1.3. Look Ma, no recursion
14.3.1.4. TreeView events
14.4. ListView
14.4.1. Windows Explorer Clone
14.4.1.1. Creating the form
14.4.1.2. Setting events
14.4.1.3. Creating the menus
14.4.1.4. Populating the ListView
14.4.1.5. Adding SubItems to the ListView
14.4.1.6. Activation
14.4.1.7. Sorting by Text property
14.4.1.8. Sorting by clicking on a column
14.4.2. Editing the Labels
14.4.3. Complete Code Listings
15. List Controls
15.1. Class Hierarchy
15.2. ListControls
15.2.1. Filling a ListControl
15.2.1.1. Filling a ListControl via the Items collection
15.2.1.2. Filling a ListControl using a DataSource
15.2.2. Retrieving Item Text
15.2.3. ListControl Events
15.2.4. ListBox
15.2.4.1. CheckedListBox
15.2.5. ComboBox
16. Date and Time Controls
16.1. Class Hierarchy
16.2. Date and Time Values
16.2.1. DateTime Structure
16.2.2. TimeSpan Structure
16.2.3. Date and Time Format Strings
16.3. DateTimePicker
16.4. MonthCalendar
16.5. Timer Component
17. Custom Controls
17.1. Specializing an Existing Control
17.1.1. Testing the Control
17.1.2. Adding Properties
17.2. Creating a User Control
17.2.1. Teeter Totter Analysis
17.2.2. Properties
17.2.3. Handling Internal Events
17.2.4. Publishing Events
17.2.5. Testing the User Control
17.2.5.1. Creating the Teeter Totter tester project
17.2.5.2. Interacting with properties
17.2.5.3. Handling events
17.2.5.4. Handling the event in C#
17.2.5.5. Handling the event In Visual Basic .NET
17.2.5.6. Populating the listbox
17.3. Creating Custom Controls from Scratch
17.3.1. Testing the custom control
18. Menus and Bars
18.1. Creating Your First Menu
18.2. The MainMenu Object
18.2.1. Adding Menu Items
18.2.2. Responding to Events
18.2.2.1. Adding MDI Windows
18.2.3. Option Menu Items
18.2.4. Shared Event Handlers
18.2.4.1. Handling radio button options
18.2.5. Menu Navigation
18.2.5.1. Shortcut keys
18.2.6. Creating Menus by Hand
18.2.6.1. Analysis
18.2.6.2. Creating the options menu
18.2.6.3. The options menu item event handler
18.2.7. Merging Menus
18.2.7.1. Merging menus by hand
18.2.8. OwnerDraw Menus
18.2.8.1. Create the bitmaps
18.2.8.2. Set the OwnerDraw property
18.2.8.3. Implement the event handlers
18.2.9. Context Menus
18.3. Toolbars
18.3.1. Creating the ImageList
18.3.1.1. Adding the toolbar
18.3.1.2. Adding event handlers
18.3.1.3. Tool tips
18.3.1.4. Altering the appearance
18.3.1.5. Adding a combo box to the Toolbar
18.4. Writing It by Hand
18.4.1. Creating the Toolbar by Hand: Analysis
18.4.1.1. Adding ToolTips and setting their properties
18.4.1.2. Setting properties of the Toolbar
18.4.1.3. Handling ToolBar button clicks
18.5. Status Bars
18.5.1. Analysis
18.5.1.1. Setting the timer
18.5.1.2. Updating the status bar based on menu information
18.5.1.3. Handling status bar events
18.5.1.4. Adding a context menu
19. ADO.NET
19.1. Bug Database: A Windows Application
19.1.1. Preliminary Design Considerations
19.1.2. The Bug Database Design
19.2. The ADO.NET Object Model
19.2.1. The DataSet Class
19.2.1.1. The DataTable class
19.2.1.2. The DataRow class
19.2.2. DBCommand and DBConnection
19.2.3. The DataAdapter Object
19.3. Getting Started with ADO.NET
19.3.1. Using the Wizards
19.3.2. Command and Control Objects
19.4. Managed Providers
19.5. Binding Data
19.6. Data Reader
19.7. Creating a DataGrid
19.7.1. Controlling Column Headings
19.7.2. Displaying Parent/Child Relationships
19.7.3. Creating Data Objects by Hand
19.7.4. Creating the DataSet by Hand
19.7.4.1. Setting column properties
19.7.4.2. Setting constraints
19.7.4.3. Adding data to the table
19.7.4.4. Adding additional tables to the DataSet
19.7.4.5. Adding rows with an array of objects
19.7.5. Creating Primary Keys
19.7.6. Creating Foreign Keys
19.7.7. Creating Data Relations
20. Updating ADO.NET
20.1. Updating with SQL
20.2. Updating Data with Transactions
20.2.1. The ACID Test
20.2.2. Implementing Transactions
20.2.2.1. Database transactions
20.2.2.2. Filling in the ListBoxes
20.2.3. DataBase Transactions
20.2.4. Connection Transaction
20.3. Updating Data Using DataSets
20.3.1. The DataSet and the DataAdapter
20.3.2. Steps for Updating the Database
20.3.2.1. Creating and displaying a DataSet
20.3.2.2. Updating the records in the DataSet
20.3.2.3. Updating the DataSet
20.3.3. Updating the Database from the Dataset
20.3.3.1. The delete command
20.3.3.2. The Update command
20.3.3.3. The Insert command
20.3.3.4. Adding transaction support
20.3.3.5. Calling the Update method
20.4. Multiuser Updates
20.4.1. Lock the Records
20.4.2. Compare Original Against New
20.4.3. Handle the Errors
20.5. Command Builder
21. Exceptions and Debugging
21.1. Bugs Versus Exceptions
21.2. Exceptions
21.3. Throwing and Catching Exceptions
21.3.1. The Throw Statement
21.3.2. The Try and Catch Statements
21.3.2.1. The finally statement
21.4. Bugs
21.5. Debugging in Visual Studio .NET
21.5.1. Finding Syntax Errors
21.5.2. Debug Versus Release Mode
21.5.3. The Debug Toolbar
21.5.4. Breakpoints
21.5.4.1. Setting a breakpoint
21.5.4.2. Breakpoint window
21.5.4.3. Breakpoint properties
21.5.4.3.1. Condition
21.5.4.3.2. Hit count
21.5.4.4. Breakpoint icons
21.5.4.5. Stepping through code
21.5.4.6. Examining variables and objects
21.5.4.7. Immediate window
21.5.5. Examining Objects
21.5.5.1. Autos window
21.5.5.2. Locals window
21.5.5.3. This/Me window
21.5.5.4. Watch window
21.5.5.5. Threads window
21.5.5.6. Modules window
21.5.5.7. Disassembly window
21.5.5.8. Registers window
21.5.5.9. Memory windows
21.6. Assert Yourself
21.6.1. Side effects
21.6.1.1. Trace versus Debug
21.6.1.2. Trace and Debug methods
21.6.2. Listeners
22. Configuration and Deployment
22.1. Class Hierarchy
22.2. Configuration
22.2.1. Hierarchical Configuration
22.2.2. Configuration File Format
22.2.3. Configuration Section Handler Declarations
22.2.4. Configuration Sections
22.2.4.1. appSettings
22.2.4.2. system.diagnostics
22.2.4.3. system.net
22.2.4.4. system.web
22.2.4.5. system.windows.forms
22.2.4.6. system.runtime.remoting
22.2.5. Custom Configuration
22.2.5.1. Name/Value pairs
22.2.5.2. Objects
22.2.6. .NET Framework Configuration Tool (mscorcfg.msc)
22.3. Assemblies
22.3.1. Microsoft Intermediate Language (MSIL)
22.3.1.1. ILDASM
22.3.2. Modules
22.3.3. Manifests
22.3.4. Single- and Multimodule Assemblies
22.3.4.1. Single-file assemblies
22.3.4.2. Multimodule assemblies
22.3.4.2.1. Preparing the source files
22.3.4.2.2. Compiling the modules
22.3.4.2.3. Linking the modules into an assembly
22.3.5. Versioning
22.3.6. Private Versus Shared Assemblies
22.3.7. Strong Names
22.3.7.1. Creating a strong name, step by step
22.3.7.2. Delayed signing
22.3.8. Global Assembly Cache (GAC)
22.3.8.1. GacUtil.exe
22.3.9. Resolving and Binding Assemblies
22.4. Build Configurations
22.5. Deployment
22.5.1. Private (XCOPY) Installations
22.5.2. Windows Installer
22.5.3. Using Visual Studio .NET
22.5.3.1. Using the wizard to create a debug version
22.5.3.2. Creating a release version
22.5.3.3. Further customizations
22.5.3.3.1. File System
22.5.3.3.2. Registry
22.5.3.3.3. File Types
22.5.3.3.4. User Interface
22.5.3.3.5. Custom Actions
22.5.3.3.6. Launch Conditions
22.5.4. Internet Deployment
22.5.4.1. Auto deployment via Cabinet (CAB) files
22.5.4.2. Auto deployment via URL
22.5.4.3. Auto deployment via calling program
22.5.5. .NET Runtime Redistributable
A. Characters and Keys
About the Authors
Colophon
Copyright
Search in book...
Toggle Font Controls
Playlists
Add To
Create new playlist
Name your new playlist
Playlist description (optional)
Cancel
Create playlist
Sign In
Email address
Password
Forgot Password?
Create account
Login
or
Continue with Facebook
Continue with Google
Sign Up
Full Name
Email address
Confirm Email Address
Password
Login
Create account
or
Continue with Facebook
Continue with Google
Prev
Previous Chapter
Cover
Next
Next Chapter
A Note Regarding Supplemental Files
Programming .NET Windows Applications
Jesse Liberty
Dan Hurwitz
Beijing ⋅ Cambridge ⋅ Farnham ⋅ Köln ⋅ Sebastopol ⋅ Tokyo
Add Highlight
No Comment
..................Content has been hidden....................
You can't read the all page of ebook, please click
here
login for view all page.
Day Mode
Cloud Mode
Night Mode
Reset