Code for Windows Forms Applications
This topic is designed to help you find code that demonstrates how to perform common programming tasks in Windows Forms applications. The topics listed are code-oriented topics. If you are using Visual Studio, you can use the Windows Forms Designer to complete many of these tasks.
The tasks are divided into the following categories:
Application creation
Form manipulation
Dialog boxes
Data binding
MDI forms
Menu manipulation
Graphics and GDI+
Printing
Drag-and-drop operations
Handling user input
Interacting with COM components
How to: Bind a Windows Forms Control to a Type
How to: Handle Errors and Exceptions that Occur with Databinding
How to: Share Bound Data Across Forms Using the BindingSource Component
How to: Ensure Multiple Controls Bound to the Same Data Source Remain Synchronized
How to: Raise Change Notifications Using a BindingSource and the INotifyPropertyChanged Interface
How to: Create Standard Windows Forms Print Jobs
How to: Capture User Input from a PrintDialog at Run Time
How to: Choose the Printers Attached to a User's Computer in Windows Forms
How to: Print Graphics in Windows Forms
How to: Print a Multi-Page Text File in Windows Forms