This appendix summarizes the purposes of the most common Windows Forms controls. The
intent of this appendix is to let you know what kinds of controls are available, not to provide
an exhaustive reference.
For additional details on how to use a control, see the online documentation. The web page
describing a control is named after the control including its namespace. For example, the web
page describing the
ComboBox class is msdn.microsoft.com/library/system.windows
All of the controls listed here are in the
System.Windows.Forms namespace (which you need
to know to enter the correct URL) unless otherwise noted.
Executes a background task in parallel on a separate thread.
Events provide notiﬁcation of progress and completion (
Provides a user interface for controls bound to a data source.
Encapsulates a data source for a form. Provides methods for
manipulating the data.
A list of items with checkboxes that let the user easily select one
or more items without needing the Click/Shift+Click/Ctrl+Click
techniques used by the regular
A dialog that lets the user select a color.
A combo box.
596906bapp02.indd 477 4/7/10 12:35:32 PM
APPendix B Control Summary
A context menu. Assign this object to another control’s
ContextMenu property and the menu automatically appears
when the user right-clicks the control.
Displays a grid of data, possibly bound to a data source.
An in-memory representation of a database.
Allows the user to select a date and a time.
Displays a spin box (up-down control) that lets the user scroll
through a list of predeﬁned choices.
Displays an error indicator for other controls.
Allows a program to interact with system event logs (System.
Raises events when a directory or ﬁle changes so you can keep
track of it (although I’ve had mixed success with this control)
A panel that dynamically arranges its contents in either rows or
A dialog that lets the user select a folder (directory).
A dialog that lets the user select a font.
Displays a window on the desktop.
Groups controls inside an outline and displays a header for the
Provides a tooltip or online help for other controls.
A horizontal scrollbar.
Stores a list of images for use by other controls.
Displays non-editable text in a single font.
Displays a label that contains a hyperlink. When the user clicks
the hyperlink, the control raises an event so the program can
Displays a list of items.
Displays a group of items in four dierent views: LargeIcon,
SmallIcon, Details, and Tile.
596906bapp02.indd 478 4/7/10 12:35:32 PM
APPendix B Control Summary
Similar to a TextBox except it displays an input mask to prompt
the user and restrict entry. For example, a telephone mask might
look like (___)-___-____.
A form’s main menu.
Provides tools for creating and interacting with message queues
Allows the user to select a date or date range from a calendar.
Displays an icon in the notiﬁcation area or system tray (usually
on the right end of the taskbar). Can provide a context menu,
and the program can use the icon to indicate status to the user.
Displays a spin box (up-down control) that lets the user pick a
A dialog that lets the user select a ﬁle for opening. Can require
that the ﬁle actually exists.
A dialog that allows the user to deﬁne printer page settings,
such as margins and printout orientation.
A simple container that holds other controls. Set AutoScroll
= true to make the
Panel automatically display scrollbars if
needed. (This is its coolest feature!)
Provides access to Windows NT performance counters
Displays an image. The SizeMode property determines how
the image is sized and can take the values
Normal (clip the
image if it doesn’t ﬁt),
StretchImage (make the image ﬁt
PictureBox even if that distorts it), AutoSize (size the
PictureBox to ﬁt the image), CenterImage (center the image,
clipping it if it is too big), and
Zoom (make the image as large as
possible without distorting its shape).
A dialog that allows the user to select a printer, set printer prop-
erties, and pick the pages to print.
Represents a printed document. Catch the PrintPage event to
Displays a preview of a PrintDocument in a control.
Displays a preview of a PrintDocument in a dialog.
596906bapp02.indd 479 4/7/10 12:35:32 PM