CPropertyPage* GetActivePage( ) const;
Return Value
The pointer to the active page.
Remarks
Call this member function to retrieve the property sheet window’s active page. Use this member function to perform some action on the active page.
Example
// The code fragment below sets the last active page (i.e. the
// active page when the propertysheet was closed) to be the first
// visible page when the propertysheet is shown. The last active
// page was saved in m_LastActivePage, (a member variable of
// CDocument-derived class) when OK was selected from the
// propertysheet. CMyPropertySheet is a CPropertySheet-derived class.
BOOL CMyPropertySheet::OnInitDialog()
{
BOOL bResult = CPropertySheet::OnInitDialog();
CFrameWnd* frame = (CFrameWnd*) AfxGetMainWnd();
CPSheetDoc* doc = (CPSheetDoc*) frame->GetActiveDocument();
SetActivePage(doc->m_LastActivePage);
return bResult;
}
BOOL CMyPropertySheet::OnCommand(WPARAM wParam, LPARAM lParam)
{
if (LOWORD(wParam) == IDOK)
{
CFrameWnd* frame = (CFrameWnd*) AfxGetMainWnd();
CPSheetDoc* doc = (CPSheetDoc*) frame->GetActiveDocument();
doc->m_LastActivePage = GetPageIndex(GetActivePage());
// or GetActiveIndex()
}
return CPropertySheet::OnCommand(wParam, lParam);
}
CPropertySheet Overview | Class Members | Hierarchy Chart
See Also CPropertySheet::GetPage