Source: http://bbs.csdn.net/topics/390973895
There are three ways to do this:
First Kind
It's your cpropertypage. When you create, the original CPropertySheet class object pointer is passed in as the parent window.
cpropertypage::create (UINT nidtemplate,cwnd* pParentWnd= NULL)
Then, in the menu command message processing, use the
CPropertySheet *pparent = (CPropertySheet *) GetParent ();
pparent->setactivepage (ipage);
The second Kind
is to save the CPropertySheet object pointer in your CPropertyPage class, cpropertypage the object construction, The pointer is then setactivepage directly through the menu command message processing.
Third Kind
is to save the window handle of the CPropertySheet object in your CPropertyPage class, pass it in when the object is constructed CPropertyPage, and pass the handle to the menu command message processing CPropertySheet Send a custom message,CPropertySheet receive this message again Setactivepage
CPropertySheet tabs to enable switching between individual cpropertypage pages