Hide

SftTabs/DLL 6.5 - Tab Control

Display
Print

ActivatePage

Creates or activates a page.

C++

protected:
    virtual BOOL CSftTabsWindowPage::ActivatePage(CWnd* pParent, CSftTabs* pTabCtl) = 0;

Parameters

pParent

The CWnd based object describing the tab control's parent window.

pTabCtl

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

Returns

If TRUE is returned, the page was successfully created and activated, otherwise FALSE is returned.

Comments

The ActivatePage function creates or activates a page.

The CSftTabsWindowSheet class implementation calls this member function to Create the window associated with a page or to make the page visible.

Your CWnd based class must implement ActivatePage.

Example

This example shows the suggested implementation of the ActivatePage function:

BOOL CYourPage::ActivatePage(CWnd* pParent, CSftTabs* pTabCtl)
{
    // This is called when the user switches to a page
    if (!m_hWnd) {
        // The window doesn't exist, create it now. Make sure it's NOT VISIBLE
        // You can modify this to create another type of window instead.
        // The exact syntax of the Create function used depends on the base
        // class used.
        if (!Create(.... // Create the window
                WS_TABSTOP| // Tabstop style is important
                other_styles,
                CRect(0,0,0,0), // location
                pParent, // Parent Window
                a_control_id)) // control ID
            // make sure the above control ID does not collide with
            // IDs used by other pages or by the tab control itself
            return FALSE;
        // Additional initialization if desired
    } else {
        // The user switched back to this page
    }
    // This page is now active
    SftTabs_SetPageActive(m_hWnd, pTabCtl->m_hWnd, NULL);

    // Enable + show it, its size is 0,0,0,0, it will be resized by the tab control
    EnableWindow(TRUE);
    ShowWindow(SW_SHOW);

    return TRUE;
}

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


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