다음을 통해 공유


CMFCBaseTabCtrl Class

 

The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

The latest version of this topic can be found at CMFCBaseTabCtrl Class.

Implements the base functionality for tabbed windows.

Syntax

class CMFCBaseTabCtrl : public CWnd  

Members

Public Methods

Name Description
CMFCBaseTabCtrl::AddIcon
CMFCBaseTabCtrl::AddTab Adds a new tab to the tabbed window.
CMFCBaseTabCtrl::ApplyRestoredTabInfo
CMFCBaseTabCtrl::AutoDestroyWindow
CMFCBaseTabCtrl::CalcRectEdit
CMFCBaseTabCtrl::CleanUp
CMFCBaseTabCtrl::ClearImageList
CMFCBaseTabCtrl::DetachTab Detaches a tab from a tabbed window.
CMFCBaseTabCtrl::EnableActivateLastActive
CMFCBaseTabCtrl::EnableAutoColor Enables or disables automatic tab coloring.
CMFCBaseTabCtrl::EnableCustomToolTips Enables or disables custom tooltips for tabs.
CMFCBaseTabCtrl::EnableInPlaceEdit Enables or disables direct editing of tab labels.
CMFCBaseTabCtrl::EnableTabDetach Enables detachable tabs.
CMFCBaseTabCtrl::EnableTabSwap Enables or disables whether the user can change the tab order by using a mouse.
CMFCBaseTabCtrl::EnsureVisible Scrolls the tabs until the specified tab is visible. This method has no effect if the specified tab is already visible.
CMFCBaseTabCtrl::EnterDragMode
CMFCBaseTabCtrl::FindTargetWnd Returns a pane that contains a specified point.
CMFCBaseTabCtrl::FireChangeActiveTab
CMFCBaseTabCtrl::FireChangingActiveTab
CMFCBaseTabCtrl::GetActiveTab Returns the index of the active tab.
CMFCBaseTabCtrl::GetActiveTabColor Returns the background color of the active tab.
CMFCBaseTabCtrl::GetActiveTabTextColor Returns the text color of the active tab.
CMFCBaseTabCtrl::GetActiveWnd Returns a pointer the active page of the tab control.
CMFCBaseTabCtrl::GetAutoColors Returns a reference to the array of colors that are used for automatic coloring.
CMFCBaseTabCtrl::GetFirstVisibleTab Returns a pointer to the first visible tab.
CMFCBaseTabCtrl::GetFirstVisibleTabNum
CMFCBaseTabCtrl::GetHighlightedTab Returns the index of the currently highlighted tab.
CMFCBaseTabCtrl::GetImageList
CMFCBaseTabCtrl::GetImageSize
CMFCBaseTabCtrl::GetLastVisibleTab
CMFCBaseTabCtrl::GetLocation Returns a variable of the LOCATION data type that indicates where the tab area is positioned relative to the tab control. For example, on the top or on the bottom.
CMFCBaseTabCtrl::GetMaxWindowSize
CMFCBaseTabCtrl::GetTabArea Returns the size and the position of the tab area in the tabbed window. The position of the tab area is defined by using coordinates.
CMFCBaseTabCtrl::GetTabBkColor Returns the background color of the specified tab.
CMFCBaseTabCtrl::GetTabBorderSize Returns the size of the tab borders in the tab control.
CMFCBaseTabCtrl::GetTabByID Returns the index of the tab that is identified by a specified ID.
CMFCBaseTabCtrl::GetTabCloseButton
CMFCBaseTabCtrl::GetTabFromHwnd Returns the index of a tab that contains a specified HWND object.
CMFCBaseTabCtrl::GetTabFromPoint Returns the tab that contains a specified point.
CMFCBaseTabCtrl::GetTabFullWidth
CMFCBaseTabCtrl::GetTabHicon Returns the icon associated with the specified tab.
CMFCBaseTabCtrl::GetTabID Returns the ID of a tab by using the index of the tab.
CMFCBaseTabCtrl::GetTabIcon Returns the icon ID for a specified tab.
CMFCBaseTabCtrl::GetTabLabel Returns the text of a specified tab.
CMFCBaseTabCtrl::GetTabRect Retrieves the size and position of a specified tab.
CMFCBaseTabCtrl::GetTabsHeight
CMFCBaseTabCtrl::GetTabsRect
CMFCBaseTabCtrl::GetTabTextColor Returns the text color of a specified tab.
CMFCBaseTabCtrl::GetTabWnd Returns the pointer to a pane that resides on a specified tab page.
CMFCBaseTabCtrl::GetTabWndNoWrapper Returns the direct pointer to a control that resides on a specified tab page, even if the control has a wrapper.
CMFCBaseTabCtrl::GetTabsNum Returns the number of tabs that are contained in the tab control.
CMFCBaseTabCtrl::GetToolTipCtrl Returns a reference to the tooltip control associated with the CMFCBaseTabCtrl object.
CMFCBaseTabCtrl::GetVisibleTabsNum Returns the number of visible tabs.
CMFCBaseTabCtrl::HasImage
CMFCBaseTabCtrl::HideSingleTab Sets an option that hides a window tab, but only if the tabbed window displays a just one visible tab.
CMFCBaseTabCtrl::InsertTab Inserts a new tab.
CMFCBaseTabCtrl::InvalidateTab
CMFCBaseTabCtrl::IsActiveTabCloseButton
CMFCBaseTabCtrl::IsAutoColor Returns a value that indicates whether a tabbed window is in automatic-color mode.
CMFCBaseTabCtrl::IsAutoDestroyWindow
CMFCBaseTabCtrl::IsColored
CMFCBaseTabCtrl::IsDialogControl
CMFCBaseTabCtrl::IsDrawNoPrefix
CMFCBaseTabCtrl::IsFlatFrame Returns a value that indicates whether the frame for the tab area is flat or 3D.
CMFCBaseTabCtrl::IsFlatTab
CMFCBaseTabCtrl::IsHideSingleTab Returns a value that indicates whether the tab control is configured to hide a tab, but only if a tabbed window has just one visible tab.
CMFCBaseTabCtrl::IsIconAdded
CMFCBaseTabCtrl::IsInPlaceEdit Indicates whether users can modify the label on a tab.
CMFCBaseTabCtrl::IsLeftRightRounded
CMFCBaseTabCtrl::IsMDITab
CMFCBaseTabCtrl::IsOneNoteStyle Indicates whether a tabbed window displays tabs in Microsoft OneNote style.
CMFCBaseTabCtrl::IsPtInTabArea Checks whether a specified point exists in the tab area.
CMFCBaseTabCtrl::IsTabCloseButtonHighlighted
CMFCBaseTabCtrl::IsTabCloseButtonPressed
CMFCBaseTabCtrl::IsTabDetachable Indicates whether a tab is detachable.
CMFCBaseTabCtrl::IsTabIconOnly Indicates whether tabs display icons but not labels.
CMFCBaseTabCtrl::IsTabSwapEnabled Indicates whether the user can change tab positions by dragging tabs.
CMFCBaseTabCtrl::IsTabVisible Indicates whether a specified tab is visible.
CMFCBaseTabCtrl::IsVS2005Style
CMFCBaseTabCtrl::MoveTab
CMFCBaseTabCtrl::OnChangeTabs Called by the framework when the number of tabs changes.
CMFCBaseTabCtrl::OnDragEnter
CMFCBaseTabCtrl::OnDragLeave
CMFCBaseTabCtrl::OnDragOver
CMFCBaseTabCtrl::OnDrop
CMFCBaseTabCtrl::OnRenameTab
CMFCBaseTabCtrl::PreTranslateMessage Used by class CWinApp to translate window messages before they are dispatched to the TranslateMessage and DispatchMessage Windows functions. (Overrides CWnd::PreTranslateMessage.)
CMFCBaseTabCtrl::RecalcLayout Recalculates the internal layout of a tabbed window.
CMFCBaseTabCtrl::RemoveAllTabs Removes all tabs from the tabbed window.
CMFCBaseTabCtrl::RemoveTab Removes a tab from a tabbed window.
CMFCBaseTabCtrl::RenameTab
CMFCBaseTabCtrl::ResetImageList Resets the image list that is attached to a tabbed window.
CMFCBaseTabCtrl::Serialize Reads or writes this object from or to an archive. (Overrides CObject::Serialize.)
CMFCBaseTabCtrl::SetActiveTab Activates a tab.
CMFCBaseTabCtrl::SetActiveTabColor Sets the background color for the currently active tab.
CMFCBaseTabCtrl::SetActiveTabTextColor Sets the text color for active tabs.
CMFCBaseTabCtrl::SetAutoColors Sets the tab control colors that are applied in automatic color mode.
CMFCBaseTabCtrl::SetDockingBarWrapperRTC Sets the wrapper class that is used for any objects that are not derived from the CDockablePane Class.
CMFCBaseTabCtrl::SetDrawNoPrefix Enables and disables the processing of prefix characters when tab labels are drawn.
CMFCBaseTabCtrl::SetImageList Sets the icon image list.
CMFCBaseTabCtrl::SetLocation
CMFCBaseTabCtrl::SetTabBkColor Sets the background color for a specified tab.
CMFCBaseTabCtrl::SetTabBorderSize Sets a new tab border size.
CMFCBaseTabCtrl::SetTabHicon Sets a tab icon.
CMFCBaseTabCtrl::SetTabIcon Sets a tab icon ID.
CMFCBaseTabCtrl::SetTabIconOnly Enables and disables the "icon only" mode for a specified tab.
CMFCBaseTabCtrl::SetTabLabel Sets a tab label equal to a specified string value.
CMFCBaseTabCtrl::SetTabsHeight
CMFCBaseTabCtrl::SetTabTextColor Sets the text color for a specified tab.
CMFCBaseTabCtrl::SetTabsOrder Arranges tabs in the specified order.
CMFCBaseTabCtrl::ShowTab Shows or hides the specified tab.
CMFCBaseTabCtrl::StartRenameTab
CMFCBaseTabCtrl::SwapTabs

Protected Methods

Name Description
CMFCBaseTabCtrl::CreateWrapper Creates a wrapper for an object derived from CWnd that is not derived from CDockablePane. To dock a CMFCBaseTabCtrl object, every embedded control must either have a docking wrapper or be derived from CDockablePane.

You set the class of the wrapper by using SetDockingBayWrapperRTC.

Data Members

Name Description
CMFCBaseTabCtrl::m_bActivateTabOnRightClick Specifies whether tabs are selected by using a left mouse click or a right mouse click.
CMFCBaseTabCtrl::m_bAutoDestroyWindow Specifies whether the panes that are contained in the tabs are destroyed automatically.

Remarks

The CMFCBaseTabCtrl class is an abstract class. Therefore, it cannot be instantiated. To create a tabbed window, you must derive a class from CMFCBaseTabCtrl. The MFC library contains some derived class examples, two of which are CMFCTabCtrl Class and CMFCOutlookBarTabCtrl Class.

Starting with Visual Studio 2015, this class supports Microsoft Active Accessibility.

Customization Tips

The following tips pertain to the CMFCBaseTabCtrl Class and any classes that inherit from it:

  • If you enable detachable tabs, do not keep pointers to the tabbed windows. These detachable tabs can be created and destroyed dynamically. Therefore, pointers can become invalid.

  • You can configure the tab control so that users can move tabs dynamically on a tab control by using the mouse. This functionality is built into the CMFCBaseTabCtrl class. To enable it, call CMFCBaseTabCtrl::EnableTabSwap.

  • By default, tabs are detachable when you add them to a tab control. You can also add non-detachable tabs by using CMFCBaseTabCtrl::AddTab. If you set the parameter bDetachable to FALSE, the tab will not be detachable. You can also change whether tabs are detachable by calling the method CMFCBaseTabCtrl::EnableTabDetach.

  • Objects that are derived from the CWnd Class can be put on a dockable control bar or dockable tab. For the whole control to be docked, you must make the CWnd object dockable. To accomplish this, MFC uses a wrapper class. This wrapper class is the CDockablePaneAdapter Class. Any CWnd objects that are added to a dockable control bar or dockable tab will be wrapped inside a CDockablePaneAdapter object. You can disable the automatic wrapping by setting the parameter m_bEnableWrapping of your CMFCBaseTablCtrl object to FALSE. You can also change the class that your application will use as a wrapper by using the method CMFCBaseTabCtrl::SetDockingBarWrapperRTC.

Inheritance Hierarchy

CObject

CCmdTarget

CWnd

CMFCBaseTabCtrl

Requirements

Header: afxbasetabctrl.h

CMFCBaseTabCtrl::AddIcon

Adds an icon to the list of icons in the protected CMap``m_mapAddedIcons member.

void AddIcon(
    HICON hIcon,  
    int iIcon);

Parameters

[in] hIcon
A handle to the icon to be added.

[in] iIcon
Zero-based index of the icon in the protected CImageList``m_Images member.

Remarks

CMFCBaseTabCtrl::AddTab

Adds a new tab to the tab control.

virtual void AddTab(
    CWnd* pTabWnd,  
    LPCTSTR lpszTabLabel,  
    UINT uiImageId = (UINT)-1,,  
    BOOL bDetachable = TRUE);

 
virtual void AddTab(
    CWnd* pTabWnd,  
    UINT uiResTabLabel,  
    UINT uiImageId = (UINT)-1,  
    BOOL bDetachable = TRUE);

Parameters

[in] pTabWnd
A pointer to the window that this method represents as a new tab.

[in] lpszTabLabel
A string that contains the label for the new tab.

[in] uiImageId
An image ID from the image list. The tab control uses this image as the icon for the new tab.

[in] uiResTabLabel
The resource ID for the label.

[in] bDetachable
A Boolean parameter that determines whether the new tab is detachable.

Remarks

If pTabWnd points to an object that is not derived from the CDockablePane Class and if bDetachable is TRUE, the framework automatically creates a wrapper for the pTabWnd object. The wrapper makes the pTabWnd object detachable. By default, the wrapper is an instance of the CDockablePaneAdapter Class. If the functionality offered by the default wrapper is unacceptable, use the CMFCBaseTabCtrl::SetDockingBarWrapperRTC method to specify a different wrapper.

CMFCBaseTabCtrl::ApplyRestoredTabInfo

This topic is included for completeness. For more detail see the source code located in the VC\atlmfc\src\mfc folder of your Visual Studio installation.

virtual void ApplyRestoredTabInfo(BOOL bUseTabIndexes = FALSE);

Parameters

[in] bUseTabIndexes

Remarks

CMFCBaseTabCtrl::AutoDestroyWindow

This topic is included for completeness. For more detail see the source code located in the VC\atlmfc\src\mfc folder of your Visual Studio installation.

void AutoDestroyWindow(BOOL bAutoDestroy = TRUE);

Parameters

[in] bAutoDestroy

Remarks

CMFCBaseTabCtrl::CalcRectEdit

This topic is included for completeness. For more detail see the source code located in the VC\atlmfc\src\mfc folder of your Visual Studio installation.

virtual void CalcRectEdit(CRect& rectEdit);

Parameters

[in] rectEdit

Remarks

CMFCBaseTabCtrl::CleanUp

This topic is included for completeness. For more detail see the source code located in the VC\atlmfc\src\mfc folder of your Visual Studio installation.

virtual void CleanUp();

Remarks

CMFCBaseTabCtrl::ClearImageList

This topic is included for completeness. For more detail see the source code located in the VC\atlmfc\src\mfc folder of your Visual Studio installation.

virtual void ClearImageList();

Remarks

CMFCBaseTabCtrl::CreateWrapper

Creates a wrapper for a frame window that is derived from the CWnd Class but is not derived from the CDockablePane Class.

virtual CWnd* CreateWrapper(
    CWnd* pWndToWrap,  
    LPCTSTR lpszTabLabel,  
    BOOL bDetachable);

Parameters

[in] pWndToWrap
A pointer to the frame window that is wrapped.

[in] lpszTabLabel
A string that contains the label for the window.

[in] bDetachable
A Boolean parameter that indicates whether the window is detachable.

Return Value

A pointer to wrapper derived from the CDockablePane class if CreateWrapper successfully creates a wrapper class for pWndToWrap. If the method fails, it retruns pWndToWrap.

Remarks

A tabbed window can dock any object derived from CWnd. However, in order for a CMFCBaseTabCtrl Class object to be dockable, each object on the CMFCBaseTabCtrl must be detachable. Therefore, CMFCBaseTabCtrl automatically wraps any objects that are not derived from CDockablePane.

By default, the CMFCBaseTabCtrl creates instances of the CDockablePaneAdapter Class. To change the wrapper's default class, call CMFCBaseTabCtrl::SetDockingBarWrapperRTC.

If pWndToWrap is derived from CDockablePane, this method will not create a wrapper. Instead, it will fail and return pWndToWrap.

CMFCBaseTabCtrl::DetachTab

The framework calls this method to detach a tab from the tab control.

virtual BOOL DetachTab(
    AFX_DOCK_METHOD dockMethod,  
    int nTabNum = -1,  
    BOOL bHide = FALSE);

Parameters

[in] dockMethod
An enumerated data type provided by the CBasePane Class. This data type specifies the method that was used to detach the tab.

[in] nTabNum
The zero-based index of the tab to be detached.

[in] bHide
A Boolean parameter that indicates whether the framework should hide the detached tab.

Return Value

Nonzero if successful; otherwise 0.

Remarks

If the tab specified by nTabNum is non-detachable, this function fails and returns FALSE.

CMFCBaseTabCtrl::EnableActivateLastActive

This topic is included for completeness. For more detail see the source code located in the VC\atlmfc\src\mfc folder of your Visual Studio installation.

void EnableActivateLastActive(BOOL bLastActive = TRUE);

Parameters

[in] bLastActive

Remarks

CMFCBaseTabCtrl::EnableAutoColor

Controls whether the framework uses the automatic background colors when drawing a tab.

void EnableAutoColor(BOOL bEnable = TRUE);

Parameters

[in] bEnable
A Boolean parameter that determines whether the framework uses automatic colors.

Remarks

A tab control has an array of several predefined colors. When the framework uses automatic colors, each tab in a series of tabs is assigned the next color from this array.

By default, the automatic colors are determined by the library-defined colors. You can provide a custom array of colors by calling CMFCBaseTabCtrl::SetAutoColors.

CMFCBaseTabCtrl::EnableCustomToolTips

Enables custom tooltips for the tab control.

BOOL EnableCustomToolTips(BOOL bEnable = TRUE);

Parameters

[in] bEnable
A Boolean that determines whether to use custom tooltips.

Return Value

TRUE if successful; otherwise FALSE.

Remarks

If custom tooltips are enabled, the tab control sends the AFX_WM_ON_GET_TAB_TOOLTIP message to the main frame. If you want to support custom tooltips in your application, the main frame window must handle this method and provide the custom tooltip text. For more information about providing custom tooltip text, see CMFCTabToolTipInfo Structure.

CMFCBaseTabCtrl::EnableInPlaceEdit

Enables direct editing of the tab labels by the user.

virtual void EnableInPlaceEdit(BOOL bEnable) = 0;  

Parameters

[in] bEnable
A Boolean parameter that specifies whether to enable direct editing of the tab labels.

Remarks

By default, direct editing of the tab labels is disabled for tab controls.

You can enable direct editing for a subset of the tabs on the tab control. To do this, override the method CMFCBaseTabCtrl::StartRenameTab. StartRenameTab should return a nonzero value for all tabs that support direct editing of tab labels.

In the CMFCBaseTabCtrl Class, this method is a pure virtual function and has no implementation. If you derive a class from CMFCBaseTabCtrl, you must implement this function.

CMFCBaseTabCtrl::EnableTabDetach

Enables detachable tabs.

virtual BOOL EnableTabDetach(
    int iTab,  
    BOOL bEnable);

Parameters

[in] iTab
The zero-based index of a tab.

[in] bEnable
A Boolean that indicates whether to make the tab detachable.

Return Value

TRUE if successful; otherwise FALSE.

CMFCBaseTabCtrl::EnableTabSwap

Enables the user to change the tab order using a mouse.

void EnableTabSwap(BOOL bEnable);

Parameters

[in] bEnable
A Boolean that indicates whether to enable tab swapping.

Remarks

When tab swapping is enabled, the user can drag a tab and change its relative position in the tab control.

CMFCBaseTabCtrl::EnsureVisible

Scrolls the tabs until the specified tab is visible.

virtual BOOL EnsureVisible(int iTab);

Parameters

[in] iTab
The zero-based index of a tab.

Return Value

Nonzero if successful; otherwise 0.

Remarks

This method has no effect if the tab indicated by iTab is already visible.

By default, this method is not supported by the CMFCBaseTabCtrl Class. You should implement this function in a custom class derived from CMFCBaseTabCtrl if that custom tab control supports tab scrolling. This method is supported by the CMFCTabCtrl Class.

CMFCBaseTabCtrl::EnterDragMode

This topic is included for completeness. For more detail see the source code located in the VC\atlmfc\src\mfc folder of your Visual Studio installation.

void EnterDragMode();

Remarks

CMFCBaseTabCtrl::FindTargetWnd

Identifies the pane that contains a specified point.

virtual CWnd* FindTargetWnd(const CPoint& pt) = 0;  

Parameters

[in] pt
A point that is defined by using client-area coordinates of the CMFCBaseTabCtrl object.

Return Value

A pointer to a CWnd object if successful; otherwise NULL.

Remarks

In the CMFCBaseTabCtrl class, this method is a pure virtual function: you must implement it if you derive a class from CMFCBaseTabCtrl.

CMFCBaseTabCtrl::FireChangeActiveTab

This topic is included for completeness. For more detail see the source code located in the VC\atlmfc\src\mfc folder of your Visual Studio installation.

virtual void FireChangeActiveTab(int nNewTab);

Parameters

[in] nNewTab

Remarks

CMFCBaseTabCtrl::FireChangingActiveTab

This topic is included for completeness. For more detail see the source code located in the VC\atlmfc\src\mfc folder of your Visual Studio installation.

virtual BOOL FireChangingActiveTab(int nNewTab);

Parameters

[in] nNewTab

Return Value

Remarks

CMFCBaseTabCtrl::GetActiveTab

Retrieves the index of the currently active tab.

virtual int GetActiveTab() const;  

Return Value

The zero-based index of the active tab; -1 if there is no active tab.

CMFCBaseTabCtrl::GetActiveTabColor

Retrieves the background color of the currently active tab.

virtual COLORREF GetActiveTabColor() const;  

Return Value

A COLORREF value that specifies the background color of the active tab.

Remarks

By default, the background color of the active tab is COLOR_WINDOW. You can change the background color for the active tab by using the method CMFCBaseTabCtrl::SetActiveTabColor.

CMFCBaseTabCtrl::GetActiveTabTextColor

Retrieves the text color for the active tab.

virtual COLORREF GetActiveTabTextColor() const;  

Return Value

A COLORREF value that specifies the text color of the active tab.

Remarks

By default, the text color for active tabs is COLOR_WINDOWTEXT. You can change the text color with the method CMFCBaseTabCtrl::SetActiveTabTextColor.

CMFCBaseTabCtrl::GetActiveWnd

Retrieves a pointer to the currently active tab window.

virtual CWnd* GetActiveWnd() const;  

Return Value

A pointer to a window.

CMFCBaseTabCtrl::GetAutoColors

Retrieves the array of colors used for automatic coloring.

const CArray<COLORREF,COLORREF>& GetAutoColors() const;  

Return Value

A reference to an array of COLORREF values that the CMFCBaseTabCtrl object uses for automatic tab coloring.

Remarks

By default, the framework initializes the array of colors to library-defined colors. You can provide a custom array of colors by calling the method CMFCBaseTabCtrl::SetAutoColors.

CMFCBaseTabCtrl::GetFirstVisibleTab

Retrieves a pointer to the first visible tab.

virtual CWnd* GetFirstVisibleTab(int& iTabNum);

 
virtual CWnd* GetFirstVisibleTab(
    int iStartFrom,  
    int& iTabNum);

Parameters

[out] iTabNum
A reference to an integer. This method writes the zero-based index of the first visible tab to this parameter.

[in] iStartFrom
The zero-based index of the first tab to check.

Return Value

A pointer to the first visible tab if successful; otherwise NULL.

Remarks

If this method fails, it writes the value -1 to iStartFrom.

If iStartFrom is larger than or equal to the number of tabs in the tab control, GetFirstVisibleTab automatically fails.

CMFCBaseTabCtrl::GetFirstVisibleTabNum

This topic is included for completeness. For more detail see the source code located in the VC\atlmfc\src\mfc folder of your Visual Studio installation.

virtual int GetFirstVisibleTabNum() const;  

Return Value

Remarks

CMFCBaseTabCtrl::GetHighlightedTab

Retrieves the index of the currently highlighted tab.

int GetHighlightedTab() const;  

Return Value

The zero-based index of the highlighted tab.

CMFCBaseTabCtrl::GetImageList

This topic is included for completeness. For more detail see the source code located in the VC\atlmfc\src\mfc folder of your Visual Studio installation.

virtual const CImageList* GetImageList() const;  

Return Value

Remarks

CMFCBaseTabCtrl::GetImageSize

This topic is included for completeness. For more detail see the source code located in the VC\atlmfc\src\mfc folder of your Visual Studio installation.

virtual CSize GetImageSize() const;  

Return Value

Remarks

CMFCBaseTabCtrl::GetLastVisibleTab

This topic is included for completeness. For more detail see the source code located in the VC\atlmfc\src\mfc folder of your Visual Studio installation.

virtual CWnd* GetLastVisibleTab(int& iTabNum);

Parameters

[in] iTabNum

Return Value

Remarks

CMFCBaseTabCtrl::GetLocation

Retrieves the location of the tab area portion of the tab control.

Location GetLocation() const;  

Return Value

The location of the tab area.

Remarks

Possible tab area location values are LOCATION_BOTTOM and LOCATION_TOP.

CMFCBaseTabCtrl::GetMaxWindowSize

This topic is included for completeness. For more detail see the source code located in the VC\atlmfc\src\mfc folder of your Visual Studio installation.

virtual CSize GetMaxWindowSize() const;  

Return Value

Remarks

CMFCBaseTabCtrl::GetTabArea

Retrieves the size and position of the tab area of the tab control.

virtual void GetTabArea(
    CRect& rectTabAreaTop,  
    CRect& rectTabAreaBottom) const = 0;  

Parameters

[in] rectTabAreaTop
A reference to a CRect object. GetTabArea uses this object to store the size and position of the top tab area.

[in] rectTabAreaBottom
A reference to a CRect object. GetTabArea uses this object to store the size and position of the bottom tab area.

Remarks

After GetTabArea returns, the CRect parameters contain the size and position of the tab area in client coordinates of the tab control. If there is no tab area at the top or bottom of the tab control, rectTabAreaTop or rectTabAreaBottom are empty.

In the CMFCBaseTabCtrl Class, this method is a pure virtual function and has no implementation. If you derive a class from CMFCBaseTabCtrl, you have to implement this function.

CMFCBaseTabCtrl::GetTabBkColor

Retrieves the background color of the specified tab.

virtual COLORREF GetTabBkColor(int iTab) const;  

Parameters

[in] iTab
The zero-based index of the tab.

Return Value

A COLORREF value that indicates the background color of the specified tab; -1 if iTab is out of range.

CMFCBaseTabCtrl::GetTabBorderSize

Retrieves the size of the tab borders in the tab control.

virtual int GetTabBorderSize() const;  

Return Value

The size of the tab border, in pixels.

Remarks

The default size for the tab border is three pixels. You can change this border size with the method CMFCBaseTabCtrl::SetTabBorderSize.

CMFCBaseTabCtrl::GetTabByID

Retrieves the index of a tab based on a tab ID.

virtual int GetTabByID(int id) const;  

Parameters

[in] id
A tab ID.

Return Value

The zero-based index of a tab if it is found; -1 if the tab ID is not found.

Remarks

The tab IDs are assigned automatically when tabs are added to a tab control.

CMFCBaseTabCtrl::GetTabCloseButton

This topic is included for completeness. For more detail see the source code located in the VC\atlmfc\src\mfc folder of your Visual Studio installation.

CRect GetTabCloseButton() const;  

Return Value

Remarks

CMFCBaseTabCtrl::GetTabFromHwnd

Retrieves the index of the tab that contains the specified HWND object.

virtual int GetTabFromHwnd(HWND hwnd) const;  

Parameters

[in] hwnd
A handle to a window.

Return Value

The zero-based index of the tab if successful; -1 if no tab contains hwnd.

CMFCBaseTabCtrl::GetTabFromPoint

Retrieves the tab that contains a specified point.

virtual int GetTabFromPoint(CPoint& pt) const;  

Parameters

[in] pt
A point in client coordinates of the tab control.

Return Value

The index of the tab that contains pt; -1 if no tab contains pt.

CMFCBaseTabCtrl::GetTabFullWidth

This topic is included for completeness. For more detail see the source code located in the VC\atlmfc\src\mfc folder of your Visual Studio installation.

virtual int GetTabFullWidth(int iTab) const;  

Parameters

[in] iTab

Return Value

Remarks

CMFCBaseTabCtrl::GetTabHicon

Returns the HICON associated with the specified tab.

virtual HICON GetTabHicon(int iTab) const;  

Parameters

[in] iTab
The zero-based index for the tab.

Return Value

The HICON associated with a tab label if successful; NULL if there is no HICON or if the method fails.

CMFCBaseTabCtrl::GetTabIcon

Retrieves the icon associated with the specified tab.

virtual UINT GetTabIcon(int iTab) const;  

Parameters

[in] iTab
The zero-based index of the tab.

Return Value

The icon ID for the specified tab if successful; -1 if the index is invalid.

Remarks

The CMFCBaseTabCtrl object stores the icons in the internal CImageList object.

CMFCBaseTabCtrl::GetTabID

Retrieves the ID for a tab specified by the tab index.

int GetTabID(int iTab) const;  

Parameters

[in] iTab
The zero-based index of the tab.

Return Value

An ID of the tab or -1 if iTab is out of range.

CMFCBaseTabCtrl::GetTabLabel

Retrieves the text of a tab label.

virtual BOOL GetTabLabel(
    int iTab,  
    CString& strLabel) const;  

Parameters

[in] iTab
The zero-based index of the tab.

[out] strLabel
A reference to a CString object. This method stores the label of the tab in this parameter.

Return Value

TRUE if successful; FALSE otherwise.

Remarks

This method fails if the index iTab is invalid.

You set the label for a tab when you create the tab by using CMFCBaseTabCtrl::AddTab. You can also change the label after creation with the method CMFCBaseTabCtrl::SetTabLabel.

CMFCBaseTabCtrl::GetTabRect

Retrieves the size and position of the specified tab.

virtual BOOL GetTabRect(
    int iTab,  
    CRect& rect) const;  

Parameters

[in] iTab
The zero-based index of the tab.

[out] rect
A reference to a CRect object. This method stores the size and position of the tab in this parameter.

Return Value

TRUE if successful; FALSE if the tab index is invalid.

CMFCBaseTabCtrl::GetTabsHeight

This topic is included for completeness. For more detail see the source code located in the VC\atlmfc\src\mfc folder of your Visual Studio installation.

virtual int GetTabsHeight() const;  

Return Value

Remarks

CMFCBaseTabCtrl::GetTabsNum

Retrieves the number of tabs in the tab control.

virtual int GetTabsNum() const;  

Return Value

The number of tabs in the tab control.

CMFCBaseTabCtrl::GetTabsRect

This topic is included for completeness. For more detail see the source code located in the VC\atlmfc\src\mfc folder of your Visual Studio installation.

virtual void GetTabsRect(CRect& rect) const;  

Parameters

[in] rect

Remarks

CMFCBaseTabCtrl::GetTabTextColor

Retrieves the text color for the specified tab.

virtual COLORREF GetTabTextColor(int iTab) const;  

Parameters

[in] iTab
The zero-based index of the tab.

Return Value

A COLORREF parameter that indicates the text color of the specified tab; -1 if iTab is out of range.

CMFCBaseTabCtrl::GetTabWnd

Returns the pointer to the pane that resides on the specified tab.

virtual CWnd* GetTabWnd(int iTab) const;  

Parameters

[in] iTab
The zero-based index of a tab.

Return Value

A pointer to the CWnd object that resides on the tab that iTab specifies. NULL if iTab is invalid.

Remarks

The returned object is the one that the application added when it called either CMFCBaseTabCtrl::AddTab or CMFCBaseTabCtrl::InsertTab.

If the object on a tab has a wrapper, this method will return the wrapper for the object. For more information about wrappers, see CMFCBaseTabCtrl::CreateWrapper. If you want to access a pointer to the direct object without the wrapper, use the method CMFCBaseTabCtrl::GetTabWndNoWrapper.

CMFCBaseTabCtrl::GetTabWndNoWrapper

Returns a pointer to the control that resides on a tab, even if the control has a wrapper.

virtual CWnd* GetTabWndNoWrapper(int iTab) const;  

Parameters

[in] iTab
The zero-based index of a tab.

Return Value

A pointer to the CWnd object that resides on the specified tab; NULL if iTab is invalid.

Remarks

This method retrieves a direct pointer to the CWnd object that you added by using either the method CMFCBaseTabCtrl::AddTab or CMFCBaseTabCtrl::InsertTab. GetTabWndNoWrapper will retrieve a pointer to the added CWnd, even if the framework added a wrapper for the object. For more information about wrappers and the CMFCBaseTabCtrl Class, see CMFCBaseTabCtrl::CreateWrapper.

Use the method CMFCBaseTabCtrl::GetTabWnd if you do not want to ignore the wrapper class.

CMFCBaseTabCtrl::GetToolTipCtrl

Retrieves a reference to the tooltip contorl.

CToolTipCtrl& GetToolTipCtrl() const;  

Return Value

A reference to the tooltip control.

CMFCBaseTabCtrl::GetVisibleTabsNum

Retrieves the number of currently visible tabs.

virtual int GetVisibleTabsNum() const;  

Return Value

The number of visible tabs.

CMFCBaseTabCtrl::HasImage

This topic is included for completeness. For more detail see the source code located in the VC\atlmfc\src\mfc folder of your Visual Studio installation.

virtual BOOL HasImage(int iTab) const;  

Parameters

[in] iTab

Return Value

Remarks

CMFCBaseTabCtrl::HideSingleTab

Sets the option to hide the tabs for the tab control when there is one visible tab.

virtual void HideSingleTab(BOOL bHide = TRUE);

Parameters

[in] bHide
A Boolean that specifies whether to enable hiding single tabs.

Remarks

When your application is configured to hide single tabs, the framework automatically displays tabs when a second tab is added to the tab control.

CMFCBaseTabCtrl::InsertTab

Inserts a tab into the tab control.

Virtual void InsertTab(
    CWnd* pNewWnd,  
    LPCTSTR lpszTabLabel,  
    int nInsertAt,  
    UINT uiImageId = (UINT)-1,  
    BOOL bDetachable = TRUE);

 
virtual void InsertTab(
    CWnd* pNewWnd,  
    UINT uiResTabLabel,  
    int nInsertAt,  
    UINT uiImageId = (UINT)-1,  
    BOOL bDetachable = TRUE);

Parameters

[in] pNewWnd
A pointer to the window that this method adds as a new tab.

[in] lpszTabLabel
A string that contains the label for the new tab.

[in] nInsertAt
The zero-based index of the new tab.

[in] uiImageId
An image ID from the image list. The tab control uses this image as the icon for the new tab.

[in] bDetachable
A Boolean parameter that determines whether the new tab is detachable.

[in] uiResTabLabel
The resource ID for the label.

Remarks

If the object indicated by pNewWnd is not derived from the CDockablePane Class and if the bDetachable parameter is TRUE, the framework creates a special wrapper for the new tab. By default, the wrapper is an instance of the CDockablePaneAdapter Class. Use the CMFCBaseTabCtrl::SetDockingBarWrapperRTC method to create a different wrapper class. Any custom wrapper class needs to be derived from CDockablePaneAdapter.

CMFCBaseTabCtrl::InvalidateTab

This topic is included for completeness. For more detail see the source code located in the VC\atlmfc\src\mfc folder of your Visual Studio installation.

void InvalidateTab(int iTab);

Parameters

[in] iTab

Remarks

CMFCBaseTabCtrl::IsActiveTabCloseButton

This topic is included for completeness. For more detail see the source code located in the VC\atlmfc\src\mfc folder of your Visual Studio installation.

virtual BOOL IsActiveTabCloseButton() const;  

Return Value

Remarks

CMFCBaseTabCtrl::IsAutoColor

Determines whether the tab control is in autocolor mode.

BOOL IsAutoColor() const;  

Return Value

TRUE if the tab control is in autocolor mode; FALSE otherwise.

Remarks

You can enable or disable the autocolor mode by using the CMFCBaseTabCtrl::EnableAutoColor method.

CMFCBaseTabCtrl::IsAutoDestroyWindow

This topic is included for completeness. For more detail see the source code located in the VC\atlmfc\src\mfc folder of your Visual Studio installation.

BOOL IsAutoDestroyWindow() const;  

Return Value

Remarks

CMFCBaseTabCtrl::IsColored

This topic is included for completeness. For more detail see the source code located in the VC\atlmfc\src\mfc folder of your Visual Studio installation.

virtual BOOL IsColored() const;  

Return Value

Remarks

CMFCBaseTabCtrl::IsDialogControl

This topic is included for completeness. For more detail see the source code located in the VC\atlmfc\src\mfc folder of your Visual Studio installation.

BOOL IsDialogControl() const;  

Return Value

Remarks

CMFCBaseTabCtrl::IsDrawNoPrefix

This topic is included for completeness. For more detail see the source code located in the VC\atlmfc\src\mfc folder of your Visual Studio installation.

BOOL IsDrawNoPrefix() const;  

Return Value

Remarks

CMFCBaseTabCtrl::IsFlatFrame

Indicates whether the frame of the tab control is rendered in a flat style or in a 3D style.

virtual BOOL IsFlatFrame() const;  

Return Value

TRUE if the frame of the tab control is rendered in a flat style; FALSE if the frame is rendered in a 3D style.

Remarks

Use CMFCTabCtrl::SetFlatFrame to change the style for the frame of the tab control.

Tab controls that use the Outlook style cannot be rendered with flat frames. This includes the CMFCOutlookBarTabCtrl Class and any classes derived from that class.

CMFCBaseTabCtrl::IsFlatTab

This topic is included for completeness. For more detail see the source code located in the VC\atlmfc\src\mfc folder of your Visual Studio installation.

virtual BOOL IsFlatTab() const;  

Return Value

Remarks

CMFCBaseTabCtrl::IsHideSingleTab

Determines whether the tab control hides the tab label if there is only one tab.

virtual BOOL IsHideSingleTab() const;  

Return Value

TRUE if the tab control hides the tab label when it has one tab; otherwise FALSE.

Remarks

Use the method CMFCBaseTabCtrl::HideSingleTab to enable hiding the tab label when there is only one tab.

CMFCBaseTabCtrl::IsIconAdded

This topic is included for completeness. For more detail see the source code located in the VC\atlmfc\src\mfc folder of your Visual Studio installation.

BOOL IsIconAdded(
    HICON hIcon,  
    int& iIcon);

Parameters

[in] hIcon
[in] iIcon

Return Value

Remarks

CMFCBaseTabCtrl::IsInPlaceEdit

Indicates whether the tab control is configured to enable the user to dynamically modify the tab labels.

virtual BOOL IsInPlaceEdit() const;  

Return Value

Nonzero if in-place editing is enabled; otherwise 0.

Remarks

You can enable or disable in-place editing by calling the method CMFCBaseTabCtrl::EnableInPlaceEdit.

CMFCBaseTabCtrl::IsLeftRightRounded

This topic is included for completeness. For more detail see the source code located in the VC\atlmfc\src\mfc folder of your Visual Studio installation.

virtual BOOL IsLeftRightRounded() const;  

Return Value

Remarks

CMFCBaseTabCtrl::IsMDITab

This topic is included for completeness. For more detail see the source code located in the VC\atlmfc\src\mfc folder of your Visual Studio installation.

BOOL IsMDITab() const;  

Return Value

Remarks

CMFCBaseTabCtrl::IsOneNoteStyle

Determines whether tabs are displayed in the style of Microsoft OneNote.

virtual BOOL IsOneNoteStyle() const;  

Return Value

TRUE if tabs are displayed in the style of Microsoft OneNote; otherwise FALSE.

Remarks

Call the method CMDIFrameWndEx::EnableMDITabs to enable the Microsoft OneNote style. You can also enable this style when you instantiate the CMFCTabCtrl Class: simply pass the style STYLE_3D_ONENOTE to the method CMFCTabCtrl::Create.

By default, the Microsoft OneNote style is not supported in a custom class derived from the CMFCBaseTabCtrl Class. However, it is supported in the CMFCTabCtrl class.

CMFCBaseTabCtrl::IsPtInTabArea

Determines if a point is inside the tab area.

virtual BOOL IsPtInTabArea(CPoint point) const = 0;  

Parameters

[in] point
The point to test.

Return Value

Nonzero if the point is in the tab area; 0 otherwise.

Remarks

In the CMFCBaseTabCtrl Class, this method is a pure virtual function and has no implementation. If you derive a class from CMFCBaseTabCtrl, you have to implement this function.

CMFCBaseTabCtrl::IsTabCloseButtonHighlighted

This topic is included for completeness. For more detail see the source code located in the VC\atlmfc\src\mfc folder of your Visual Studio installation.

BOOL IsTabCloseButtonHighlighted() const;  

Return Value

Remarks

CMFCBaseTabCtrl::IsTabCloseButtonPressed

This topic is included for completeness. For more detail see the source code located in the VC\atlmfc\src\mfc folder of your Visual Studio installation.

BOOL IsTabCloseButtonPressed() const;  

Return Value

Remarks

CMFCBaseTabCtrl::IsTabDetachable

Determines whether a tab is detachable.

virtual BOOL IsTabDetachable(int iTab) const;  

Parameters

[in] iTab
The zero-based index of the tab to check.

Return Value

TRUE if the tab is detachable; FALSE otherwise.

Remarks

To make a tab detachable, use the method CMFCBaseTabCtrl::EnableTabDetach.

CMFCBaseTabCtrl::IsTabIconOnly

Determines whether a tab label contains only icons and no text.

virtual BOOL IsTabIconOnly(int iTab) const;  

Parameters

[in] iTab
The zero-based index of the tab.

Return Value

TRUE if a tab label has only icons; FALSE otherwise.

Remarks

To set the tabs in your application to display only icons, call the method CMFCBaseTabCtrl::SetTabIconOnly.

CMFCBaseTabCtrl::IsTabSwapEnabled

Determines whether the tab control allows the user to change tab positions by using the mouse.

BOOL IsTabSwapEnabled() const;  

Return Value

Nonzero if tab positions can be changed by the user; otherwise 0.

Remarks

By default, users cannot change the order of tabs in a tab control. Use the CMFCBaseTabCtrl::EnableTabSwap method to enable this functionality.

CMFCBaseTabCtrl::IsTabVisible

Indicates whether the specified tab is visible.

virtual BOOL IsTabVisible(int iTab) const;  

Parameters

[in] iTab
The zero-based index of the tab to check.

Return Value

Nonzero if the specified tab is visible; otherwise 0.

CMFCBaseTabCtrl::IsVS2005Style

This topic is included for completeness. For more detail see the source code located in the VC\atlmfc\src\mfc folder of your Visual Studio installation.

virtual BOOL IsVS2005Style() const;  

Return Value

Remarks

CMFCBaseTabCtrl::m_bActivateTabOnRightClick

m_bActivateTabOnRightClick determines whether tabs are in focus when the user clicks on a tab label by using the right mouse button.

BOOL m_bActivateTabOnRightClick;  

Remarks

The default value for this data member is FALSE.

CMFCBaseTabCtrl::m_bAutoDestroyWindow

m_bAutoDestroyWindow determines whether the framework automatically destroys the objects on tabs when the tabs are removed.

BOOL m_bAutoDestroyWindow;  

Remarks

By default, this member is FALSE.

CMFCBaseTabCtrl::MoveTab

This topic is included for completeness. For more detail see the source code located in the VC\atlmfc\src\mfc folder of your Visual Studio installation.

virtual void MoveTab(
    int nSource,  
    int nDest);

Parameters

[in] nSource
[in] nDest

Remarks

CMFCBaseTabCtrl::OnChangeTabs

The framework calls this method when the number of tabs on a tab control changes.

virtual void OnChangeTabs();

Remarks

By default, this method does nothing. Override this method to execute custom code when the number of tabs on the tab control changes.

CMFCBaseTabCtrl::OnDrop

This topic is included for completeness. For more detail see the source code located in the VC\atlmfc\src\mfc folder of your Visual Studio installation.

virtual BOOL OnDrop(
    COleDataObject*,
    DROPEFFECT,
    CPoint);

Parameters

[in] COleDataObject*
[in] DROPEFFECT
[in] CPoint

Return Value

Remarks

CMFCBaseTabCtrl::OnDragOver

This topic is included for completeness. For more detail see the source code located in the VC\atlmfc\src\mfc folder of your Visual Studio installation.

virtual DROPEFFECT OnDragOver(
    COleDataObject*,
    DWORD,
    CPoint);

Parameters

[in] COleDataObject*
[in] DWORD
[in] CPoint

Return Value

Remarks

CMFCBaseTabCtrl::OnDragLeave

This topic is included for completeness. For more detail see the source code located in the VC\atlmfc\src\mfc folder of your Visual Studio installation.

virtual void OnDragLeave();

Remarks

CMFCBaseTabCtrl::OnDragEnter

This topic is included for completeness. For more detail see the source code located in the VC\atlmfc\src\mfc folder of your Visual Studio installation.

virtual DROPEFFECT OnDragEnter(
    COleDataObject*,
    DWORD,
    CPoint);

Parameters

[in] COleDataObject*
[in] DWORD
[in] CPoint

Return Value

Remarks

CMFCBaseTabCtrl::OnRenameTab

This topic is included for completeness. For more detail see the source code located in the VC\atlmfc\src\mfc folder of your Visual Studio installation.

virtual BOOL OnRenameTab(int, CString&);

Parameters

[in] int
[in] CString&

Return Value

Remarks

CMFCBaseTabCtrl::PreTranslateMessage

This topic is included for completeness. For more detail see the source code located in the VC\atlmfc\src\mfc folder of your Visual Studio installation.

virtual BOOL PreTranslateMessage(MSG* pMsg);

Parameters

[in] pMsg

Return Value

Remarks

CMFCBaseTabCtrl::RecalcLayout

Recalculates the internal layout of the tab control.

virtual void RecalcLayout() = 0;  

Remarks

In the CMFCBaseTabCtrl Class, this method is a pure virtual function. If you derive a class from CMFCBaseTabCtrl, you have to implement this function.

CMFCBaseTabCtrl::RemoveAllTabs

Removes all the tabs from the tab control.

virtual void RemoveAllTabs();

Remarks

If CMFCBaseTabCtrl::m_bAutoDestroyWindow is TRUE, the framework deletes all the CWnd objects attached to the removed tabs.

CMFCBaseTabCtrl::RemoveTab

Removes a tab from the tab control.

virtual BOOL RemoveTab(
    int iTab,  
    BOOL bRecalcLayout = TRUE);

Parameters

[in] iTab
The zero-based index of a tab.

[in] bRecalcLayout
A Boolean parameter that specifies whether to recalculate the layout of the tab.

Return Value

TRUE if the method removes the tab successfully; otherwise FALSE.

Remarks

If CMFCBaseTabCtrl::m_bAutoDestroyWindow is TRUE, RemoveTab destroys the CWnd object associated with the specified tab.

CMFCBaseTabCtrl::RenameTab

This topic is included for completeness. For more detail see the source code located in the VC\atlmfc\src\mfc folder of your Visual Studio installation.

virtual BOOL RenameTab();

Return Value

Remarks

CMFCBaseTabCtrl::ResetImageList

Resets the image list for an instance of the CMFCBaseTabCtrl Class.

void ResetImageList();

CMFCBaseTabCtrl::Serialize

This topic is included for completeness. For more detail see the source code located in the VC\atlmfc\src\mfc folder of your Visual Studio installation.

virtual void Serialize(CArchive& ar);

Parameters

[in] ar

Remarks

CMFCBaseTabCtrl::SetActiveTab

Activates the specified tab.

virtual BOOL SetActiveTab(int iTab) = 0;  

Parameters

[in] iTab
The zero-based index of a tab. SetActiveTab makes the tab with this index active.

Return Value

TRUE if successful; otherwise FALSE.

Remarks

In the CMFCBaseTabCtrl Class, this method is a pure virtual function. If you derive a class from CMFCBaseTabCtrl, you have to implement this function.

CMFCBaseTabCtrl::SetActiveTabColor

Sets the background color for the active tab.

virtual void SetActiveTabColor(COLORREF clr);

Parameters

[in] clr
Specifies the new background color.

Remarks

The framework obtains the default background color for active tabs from the GetSysColormethod.

CMFCBaseTabCtrl::SetActiveTabTextColor

Sets the text color for active tabs.

virtual void SetActiveTabTextColor(COLORREF clr);

Parameters

[in] clr
A COLORREF parameter that specifies the new text color.

Remarks

By default, the framework obtains the text color from GetSysColor. Override this default color by using the SetActiveTabTextColor method.

CMFCBaseTabCtrl::SetAutoColors

Sets the colors of the tab control that the framework uses in automatic color mode.

void SetAutoColors(const CArray<COLORREF,COLORREF>& arColors);

Parameters

[in] arColors
An array of RGB colors.

Remarks

If you provide a custom array of colors, the default array of colors is ignored. If the parameter arColors is empty, the framework reverts to the default array of colors.

To enable autocolor mode, use the CMFCBaseTabCtrl::EnableAutoColor method.

CMFCBaseTabCtrl::SetDockingBarWrapperRTC

Sets the wrapper class that is used for any objects that are not derived from the CDockablePane Class.

void SetDockingBarWrapperRTC(CRuntimeClass* pRTC);

Parameters

[in] pRTC
The runtime class information for the new wrapper class.

Remarks

You add tabs to a tab control by using the methods CMFCBaseTabCtrl::AddTab and CMFCBaseTabCtrl::InsertTab. When you add a tab, each control on that tab must be dockable. Any objects that are not derived from CDockablePane must be wrapped. AddTab and InsertTab create a wrapper for these objects. The default wrapper class is the CDockablePaneAdapter Class. The method SetDockingBarWrapperRTC enables you to change the class that is used as a wrapper class. The wrapper class that you provide must be derived from CDockablePaneAdapter.

CMFCBaseTabCtrl::SetDrawNoPrefix

Enables and disables the processing of prefix characters in tab labels.

void SetDrawNoPrefix(
    BOOL bNoPrefix,  
    BOOL bRedraw = TRUE);

Parameters

[in] bNoPrefix
TRUE if you want to process prefix characters; otherwise FALSE.

[in] bRedraw
TRUE if you want to redraw the tabbed window; otherwise FALSE.

Remarks

A prefix character is a mnemonic character that is preceded by an ampersand (&).

CMFCBaseTabCtrl::SetImageList

Sets the icon image list for the tab control.

virtual BOOL SetImageList(
    UINT uiID,  
    int cx = 15,  
    COLORREF clrTransp = RGB(255, 0, 255));  
  
virtual BOOL SetImageList(HIMAGELIST hImageList);

Parameters

[in] uiID
A bitmap resource ID. SetImageList loads the image list from this resource.

[in] cx
The width of each image in pixels.

[in] clrTransp
A COLORREF parameter that indicates the transparent color of the image.

[in] hImageList
A handle to a preloaded image list.

Return Value

Nonzero if the method was successful; 0 otherwise.

Remarks

The images from the icon image list are displayed alongside the labels for the tab. To display an icon, you must specify its index when you call CMFCBaseTabCtrl::AddTab.

SetImageList will fail if the tab control was created with a flat style. It will also fail if the framework cannot load the image indicated by uiID.

This method recalculates the height of the tab according to the image and text sizes.

CMFCBaseTabCtrl::SetLocation

This topic is included for completeness. For more detail see the source code located in the VC\atlmfc\src\mfc folder of your Visual Studio installation.

virtual void SetLocation(Location location);

Parameters

[in] location

Remarks

CMFCBaseTabCtrl::SetTabBkColor

Sets the background color for the specified tab.

virtual BOOL SetTabBkColor(
    int iTab,  
    COLORREF color = (COLORREF)-1);

Parameters

[in] iTab
The zero-based index of the tab.

[in] color
The color to set.

Return Value

TRUE if successful; FALSE otherwise.

CMFCBaseTabCtrl::SetTabBorderSize

Sets a new border size for the tab control.

virtual void SetTabBorderSize(
    int nTabBorderSize,  
    BOOL bRepaint = TRUE);

Parameters

[in] nTabBorderSize
The new border size, in pixels.

[in] bRepaint
A Boolean parameter that indicates whether the framework redraws the control.

CMFCBaseTabCtrl::SetTabHicon

Sets the icon for a tab label.

virtual BOOL SetTabHicon(
    int iTab,  
    HICON hIcon);

Parameters

[in] iTab
The zero-based index of a tab. This method changes the icon for this tab.

[in] hIcon
A handle to an icon.

Return Value

TRUE if successful; otherwise FALSE.

CMFCBaseTabCtrl::SetTabIcon

Sets the icon for a tab.

virtual BOOL SetTabIcon(
    int iTab,  
    UINT uiIcon);

Parameters

[in] iTab
The zero-based index of the tab to update.

[in] uiIcon
The icon ID for the new icon. This ID references the internal CImageList object.

Return Value

TRUE if successful; otherwise FALSE.

CMFCBaseTabCtrl::SetTabIconOnly

Enables displaying only an icon (and no text label) on a specific tab.

virtual BOOL SetTabIconOnly(
    int iTab,  
    BOOL bIconOnly = TRUE,  
    BOOL bShowTooltipAlways = FALSE);

Parameters

[in] iTab
The zero-based index of the tab to change.

[in] bIconOnly
A Boolean parameter that determines whether to display only icons.

[in] bShowTooltipAlways
A Boolean parameter that determines whether the framework shows tooltips for a tab label that displays only icons.

Return Value

TRUE if successful; otherwise FALSE.

Remarks

By default, a tab control displays the icon and text label for each tab.

CMFCBaseTabCtrl::SetTabLabel

Sets the text for a tab label.

virtual BOOL SetTabLabel(
    int iTab,  
    const CString& strLabel);

Parameters

[in] iTab
The zero-based index of the tab to update.

[in] strLabel
A reference to a string that contains the new text for the tab label.

Return Value

Nonzero if successful; 0 otherwise.

CMFCBaseTabCtrl::SetTabsHeight

This topic is included for completeness. For more detail see the source code located in the VC\atlmfc\src\mfc folder of your Visual Studio installation.

virtual void SetTabsHeight();

Remarks

CMFCBaseTabCtrl::SetTabsOrder

Arranges the tabs in the specified order.

BOOL SetTabsOrder(const CArray<int,int>& arOrder);

Parameters

[in] arOrder
An array of zero-based indexes that defines the new tab order.

Return Value

TRUE if successful; FAIL otherwise.

Remarks

The size of the arOrder array must be equal to the number of tabs in the tab control.

CMFCBaseTabCtrl::SetTabTextColor

Sets the text color for a specific tab.

virtual BOOL SetTabTextColor(
    int iTab,  
    COLORREF color = (COLORREF)-1);

Parameters

[in] iTab
The zero-based index of the tab.

[in] color
A COLORREF parameter that indicates the new text color.

Return Value

Nonzero if successful; 0 otherwise.

CMFCBaseTabCtrl::ShowTab

Shows or hides the specified tab.

virtual BOOL ShowTab(
    int iTab,  
    BOOL bShow = TRUE,  
    BOOL bRecalcLayout = TRUE,  
    BOOL bActivate = FALSE);

Parameters

[in] iTab
The index of the tab that ShowTab will show or hide.

[in] bShow
A Boolean parameter that indicates whether to show the tab.

[in] bRecalcLayout
A Boolean parameter that indicates whether to immediately recalculate the window layout.

[in] bActivate
A Boolean parameter that indicates whether to select the tab specified by iTab.

Return Value

Nonzero if successful; otherwise 0.

Remarks

The parameter bActivate only applies if bShow is TRUE. If bActivate is TRUE and if ShowTab is successful, ShowTab will send the message AFX_WM_CHANGE_ACTIVE_TAB to the parent of the tab window.

CMFCBaseTabCtrl::StartRenameTab

This topic is included for completeness. For more detail see the source code located in the VC\atlmfc\src\mfc folder of your Visual Studio installation.

virtual BOOL StartRenameTab(int iTab);

Parameters

[in] iTab

Return Value

Remarks

CMFCBaseTabCtrl::SwapTabs

This topic is included for completeness. For more detail see the source code located in the VC\atlmfc\src\mfc folder of your Visual Studio installation.

virtual void SwapTabs(
    int nFisrtTabID,  
    int nSecondTabID);

Parameters

[in] nFisrtTabID
[in] nSecondTabID

Remarks

See Also

Hierarchy Chart
Classes
CMFCTabCtrl Class
CMFCOutlookBarTabCtrl Class