HeaderPane
Main
Hide
Share Link
Print

AllowSwitch

Determines whether a currently active page can be left and a new page activated.

C++

virtual BOOL CSftTabsPage::AllowSwitch();

Returns

If TRUE is returned, the current page will be deactivated and another page will become active, otherwise the current page (and associated tab) cannot be changed.

Comments

The AllowSwitch function determines whether a currently active page can be left and a new page activated.

The default implementation of this member function returns TRUE after performing automatic data validation and exchange for the page.

An application can override this function to perform additional tests such as input validation, to determine if the page can be left.

Example

C++

BOOL CPage2::AllowSwitch()
{
    if (!UpdateData(TRUE) || m_Check1 == 0) {
        AfxMessageBox(_T("Please check the checkbox on the dialog to be able to switch to another tab."), MB_OK);

        return FALSE;
    }
    return TRUE;                        // Allow switching away from this page
}

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


Last Updated 10/11/2026 - (email)
© 2026 Softel vdm, Inc.