
With this style, all tabs can be displayed at once. You can cause a tab control to display multiple rows of tabs, if necessary, by specifying the TCS_MULTILINE style. If not all tabs can be shown at once, the tab control displays an up-down control so that the user can scroll additional tabs into view. You can specify that a tab does not receive input focus when clicked by using the TCS_FOCUSNEVER style.īy default, a tab control displays only one row of tabs. This style is typically used only with the TCS_BUTTONS style. You can cause a tab to receive the input focus when clicked by specifying the TCS_FOCUSONBUTTONDOWN style. Because the display area in a button tab control is typically not used, no border is drawn around it. Tabs in this type of tab control should serve the same function as button controls that is, clicking a tab should carry out a command instead of displaying a page.

You can cause the tabs to look like buttons by specifying the TCS_BUTTONS style. For example, you can specify the alignment and general appearance of the tabs in a tab control. You can apply certain characteristics to tab controls by specifying tab control styles when the control is created. However, you can disable a tab control in a property sheet by disabling the corresponding page. You cannot disable an individual tab in a tab control. Each message has a corresponding macro that you can use instead of sending the message explicitly. You send messages to a tab control to add tabs and otherwise affect the control's appearance and behavior. In Microsoft Visual Studio, you can create a tab control by using the Toolbox. To ensure that the DLL is loaded, use the InitCommonControlsEx function. This window class is registered when the common controls DLL is loaded. You can create a tab control by calling the CreateWindowEx function, specifying the WC_TABCONTROL window class.

This topic includes the following sections. The following screen shot shows a simple tab control that contains tabs for days of the week. Each page consists of a certain type of information or a group of controls that the application displays when the user selects the corresponding tab.

By using a tab control, an application can define multiple pages for the same area of a window or dialog box. A tab control is analogous to the dividers in a notebook or the labels in a file cabinet.
