1. the dialog box attribute used as the ctabctrl sub-control must be child.
2. initialize ctabctrl
M_tab.insertitem (0, "page0 Beijing ");
M_tab.insertitem (1, "page1 Shanghai ");
M_tab.insertitem (2, "page2 Jiangxi ");
// Create an attribute page
Page1.create (idd_dialog1, getdlgitem (idc_tab1 ));
Page2.create (idd_dialog2, getdlgitem (idc_tab1 ));
// Set the page location within the m_tab control range
Crect RS;
M_tab.getclientrect (RS );
Rs. Top + = 20;
Rs. Bottom-= 4;
Rs. Left + = 4;
Rs. Right-= 4;
Page1.movewindow (RS );
Page2.movewindow (RS );
Page1.showwindow (true );
M_tab.setcursel (1 );
3. Response Functions
Void ctestview: onselchangetab1 (nmhdr * pnmhdr, lresult * presult)
{
// Todo: add your control notification handler code here
Int cursel;
Cursel = m_tab.getcursel ();
Switch (cursel)
{
Case 0:
Page1.showwindow (false );
Page2.showwindow (false );
..
Break;
Default :;
}
* Presult = 0;
}