1. Create three Tabs dialog form, change the ID to PorpTest1, porpTest2, PORPTEST3, respectively
2. Create three tab classes with class names CPropTest1, CPropTest2, CPROPTEST3, respectively
3, create a tab of the parent class, the class name is: Cproptest
4. Add 3 member variables for the parent class Cproptest, named M_proptest1, M_proptest2, M_PROPTEST3, respectively
5. A header file that introduces 3 subclasses for the parent class (introduced in the parent class's source file)
" PropTest1.h " "PropTest2.h " "PropTest3.h"
6. Add a tab to the parent class
Cproptest::cproptest (UINT nidcaption, cwnd* pParentWnd, uint iselectpage) : CPropertySheet (Nidcaption, pParentWnd, iselectpage) { AddPage (&m_proptest1); AddPage (&m_proptest2); AddPage (&m_proptest3);} Cproptest::cproptest (LPCTSTR pszcaption, CWnd* pParentWnd, UINT iselectpage) : CPropertySheet ( Pszcaption, pParentWnd, iselectpage) { AddPage (&m_proptest1); AddPage (&m_proptest2); AddPage (&m_proptest3);}
7, the tab has been created, any add a call control, bring up the tab. Add a reference to the tab parent class in the control's response function, and add the calling function.
" PropTest.h "
void Cmfctestdlg::onbnclickedbtnselect () { // TODO: Add control notification handler code here cproptest Proptest (TEXT (" tab Test ")); Proptest. DoModal ();}
MFC Create tab