Home > Articles > Programming > Windows Programming

  • Print
  • + Share This
This chapter is from the book

This chapter is from the book


A control is a specialized window with specific features and a unique purpose. These are things like buttons, labels, and lists. Table 16.1 introduces each of the standard Windows Forms controls and explains how they're used.

Table 16.1 Windows Forms Controls


How It's Used


Controls that can be clicked to perform some desired action.


Primarily used for displaying a binary state of an object. Clicking the CheckBox causes it to toggle between a checked and unchecked state.


ListBox with a column of CheckBoxes. These are superior to using normal ListBox semantics where multiple items are selected by using the Ctrl and Shift keys when selecting items. It allows users to select each item they want without worrying about losing all their choices if they forget to hold down the Ctrl or Shift key.


A drop-down list of choices that operates similar to the ListBox. The primary difference is that the ComboBox is more compact and efficient with screen real estate.


An extremely powerful control that permits a program to bind to a data source.


Provides a capability to select a date and time without typing.


Permits a user to scroll through a list of data items that can only be shown one at a time.


The main window of an application, a dialog, or a multiple-document interface (MDI) child. It provides all the capabilities for hosting child controls.


Houses a group of other controls, often used to encapsulate a group of RadioButtons. It can help organize a form and has a customizable title.


Used to display static text. Labels can also contain images. Although they can be programmed for more functionality, such as reacting to double-clicks, other control types are probably more appropriate for more complex tasks.


The same as a Label, but it can contain an URL that can be clicked to invoke an Internet connection.


Holds selectable lists of data items. When the viewable portion of the ListBox is filled, a scrollbar appears so all of its contained items may be selected.


Provides capabilities for multiple columns, column headers, column resizing, and list sorting. It can also be configured in four different display modes. More sophisticated than a ListBox.


Provides notifications to users on certain program events. It has a configurable message, title bar, icon, and button.


A visual calendar control.


The same as a DomainUpDown with the restriction that its contents are numeric.


Blank forms with little or no decoration that are used primarily for organization and form layout.


Displays an image.


Used to display the status of an ongoing operation. It has a graphical indicator, set by a program to show the percentage of task completion.


For user interface type applications, to set and display a list of properties associated with a certain component.


Mutually exclusive buttons that permit users to make a choice. Also called option buttons.


An enhanced TextBox control that provides more control over its text. It has the capability of creating Rich Text Format (RTF) files.


Often used to help position the current location in a document that's too large to fit onscreen or in whatever space is available.


-Permit a user to resize multiple portions of a workspace. When the splitter is moved, one portion of the workspace gets larger, and others become smaller.


Performs multiple functions. Primarily it's a place to notify users of a program's status or other forms of current information.


User interfaces that appear like file folder tabs. When selected, they open a specific page where the tab and content match.


Allows a user to type text. They can be single or multi-line and have many capabilities for text manipulation such as selection, cut, copy, and paste.


Nonvisual controls that raise events at specified intervals. They can be used for such things as reminders or auto-save operations.


Permits a user to invoke selected operations in a program; similar in functionality to Menus.


Helpful messages that appear when a cursor hovers over a control for a specified amount of time.


Controls that provide a means to establish settings for a certain purpose. They are often handy in specifying the frequency or speed in which an operation should occur.


Icons displayed on the icon tray of the window's task bar. They usually have different pictures to indicate the current state of a program.


Displays items in a hierarchical fashion. It has a root node at the top of the tree and can have multiple branches and nodes. Traditionally it has collapsible branches and is coordinated with another control to display details of selected nodes.

It's evident from Table 16.1 that there is a plentiful supply of graphical components and controls available with Windows Forms. These can be combined to create relatively sophisticated applications. The next section shows how to use C# to build an application with a healthy subset of these components.

  • + Share This
  • 🔖 Save To Your Account