Hide

SftTabs/DLL 6.5 - Tab Control

Display
Print

TabSwitching

Handles the SFTTABSN_SWITCHING notification.

C++

protected:
    void CSftTabsWindowSheet::TabSwitching(CWnd* pParent, CSftTabs* pTabCtl);

Parameters

pParent

The CWnd based object describing the parent window.

pTabCtl

A pointer to the tab control's CSftTabs based object.

Comments

The TabSwitching function handles the SFTTABSN_SWITCHING notification.

A tabbed window must call this function to process the SFTTABSN_SWITCHING notification that is generated by the tab control to switch between pages.

TabSwitching calls the CSftTabsWindowPage::AllowSwitch function of the current page to determine if the next page can be activated. GetNextTab returns the index of the next tab about to become active. By sending a WM_CANCELMODE message, an application can prevent the tab control from activating the next page.

Message map entries must also be added to the tab control's parent window.

Example

This example implements the suggested OnTabSwitching function that calls TabSwitching to switch between pages:

// Add the following definitions to the tab control's parent window
// class CYourSheet
afx_msg void OnTabSwitching();
afx_msg void OnTabSwitched();

// Add the following to the parent window's message map
ON_SFTTABSN_SWITCHING(IDC_TAB, OnTabSwitching)
ON_SFTTABSN_SWITCHED(IDC_TAB, OnTabSwitched)

// Implement the following functions in CYourSheet
void CYourSheet::OnTabSwitching()
{
    TabSwitching(this, &m_Tab);
}

void CYourSheet::OnTabSwitched()
{
    TabSwitched(this, &m_Tab);
}

See Also C/C++ API | C++ Classes | Notifications


Last Updated 08/13/2020 - (email)
© 2024 Softel vdm, Inc.