SECTabControlBase::InsertTab
SECTab*SECTabControlBase::InsertTab(intnIndex, LPCTSTRlpszLabel, CObject*pClient, HMENUhMenu, void*pExtra)
A new tab is created and inserted immediately before the tab with the index nIndex. The display positions of all tabs to the right of the new tab are recomputed and a repaint occurs.
The label specified by lpszLabel becomes the new tab’s label.
The third parameter is treated as client data which is associated with the tab. Usually, this will be a pointer to a CWnd - derived class which should be shown when its associated tab is active. However, the pClient parameter doesn’t have to be a CWnd-derivative since the SECTabControlBase (and its implementations) only store this data.
The hMenu parameter is an optional menu which should be shown when the tab is active. The pExtra parameter is an optional opaque pointer to user-defined data which the caller needs to associate with the new tab.
As long as you have a tab index, the user can call GetTabInfo to retrieve any of the data members (pClient, hMenu, or pExtra) associated with the new tab.
Upon successful completion, this function returns a pointer to the new tab. You can use this pointer to initialize or change any tab attributes immediately following the call to InsertTab.
Defined in: tabctrlb.cpp
Return Value
A pointer to the new SECTab object; NULL if a failure occurred.
Parameters
nIndex
Index of tab to insert before.
lpszLabel
Label to be shown on the new tab.
pClient
A pointer to the client to associate with the new tab.
hMenu
The menu to show when the tab is active.
pExtra
A pointer to user-defined data.
See Also