8.2.2 Choosing a Control Style

The control styles, which depend on the control class, determine the control's appearance and function. You specify a control style when creating the control, by including the style (for example, BS_PUSHBUTTON) in the dwStyle parameter of the CreateWindow function.

Windows provides many predefined control styles. Following are some of the most common:

Style Description

BS_PUSHBUTTON Specifies a push button, a small window containing a label that the user can choose in order to notify the parent window.
BS_DEFPUSHBUTTON Specifies a default push button, which is identical to a push button except that it has a special border.
BS_CHECKBOX Specifies a check box, which the user can select to turn the control on or off. When the control is on, the box contains an X.
BS_RADIOBUTTON Specifies a radio button (a circle). The user can select the circle to turn the control on or off. When the control is on, the circle contains a solid bullet.
ES_LEFT Specifies a single-line, left-aligned edit control.
ES_MULTILINE Specifies a multiline edit control.
SS_LEFT Specifies a left-aligned, static edit control.
SS_RIGHT Specifies a right-aligned, static edit control.
LBS_STANDARD Specifies a standard list box. A standard list box includes a scroll bar and notifies its parent window when the user makes a selection.
CBS_DROPDOWN Specifies a combo box consisting of an edit control and a list box that is displayed when the user selects a box next to the selection field. If the user selects an item in the list box, the edit control displays the selected item.

For a complete list of control styles, see the Microsoft Windows Programmer's Reference, Volume 4.