MFC Create tab

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.