Share via


CMFCBaseTabCtrl Class

Implements the base functionality for tabbed windows.

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.

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

See Also

Reference

Hierarchy Chart

CMFCTabCtrl Class

CMFCOutlookBarTabCtrl Class

Other Resources

MFC Classes