Creating the Tab Control
How the tab control is created depends on whether you are using the control in a dialog box or creating it in a nondialog window.
To use CTabCtrl directly in a dialog box
In the dialog editor, add a Tab Control to your dialog template resource. Specify its control ID.
Map handler functions in the dialog class for any tab control notification messages you need to handle. For more information, see Mapping Messages to Functions.
In OnInitDialog, set the styles for the CTabCtrl.
To use CTabCtrl in a nondialog window
Define the control in the view or window class.
Call the control's Create member function, possibly in OnInitialUpdate, possibly as early as the parent window's OnCreate handler function (if you're subclassing the control). Set the styles for the control.
After the CTabCtrl object has been created, you can set or clear the following extended styles:
TCS_EX_FLATSEPARATORS The tab control will draw separators between the tab items. This extended style only affects tab controls that have the TCS_BUTTONS and TCS_FLATBUTTONS styles. By default, creating the tab control with the TCS_FLATBUTTONS style sets this extended style.
TCS_EX_REGISTERDROP The tab control generates TCN_GETOBJECT notification messages to request a drop target object when an object is dragged over the tab items in the control.
To receive the TCN_GETOBJECT notification, you must initialize the OLE libraries with a call to AfxOleInit.
For instance, set the TCS_EX_FLATSEPARATORS style with the following lines of code:
Clear the TCS_EX_FLATSEPARATORS style from a CTabCtrl object with the following lines of code:
This will remove the separators that appear between the buttons of your CTabCtrl object.