多简单的问题,做过的人肯定很多,但我没用过。
CPropertySheet我用过,画一些对话框然后加进去就行了。
CTabCtrl怎么搞?

解决方案 »

  1.   

    BOOL InsertItem( int nItem, TCITEM* pTabCtrlItem );BOOL InsertItem( int nItem, LPCTSTR lpszItem );BOOL InsertItem( int nItem, LPCTSTR lpszItem, int nImage );BOOL InsertItem( UINT nMask, int nItem, LPCTSTR lpszItem, int nImage, LPARAM lParam );好像都只是加一个页面,页面上的控件怎么办?
      

  2.   

    声明消息处理宏ON_NOTIFY(TCN_SELCHANGE, IDC_TABCTRLBAR, OnTabSelChange)void OnTabSelChange(NMHDR* pNMHDR, LRESULT* pResult)
    {
       //TODO:Handle your control for different tab pages.
       if(m_tabCtrl.GetCurSel == 0)
       {
           //xxx.Create();
       }
       else if(... == 1)
       ...
    }
      

  3.   

    如果东东少,可以在窗口中全部创建,然后根据当前激活页面来决定哪些显示哪些不显示。如果东东多,可以创建好若干个dialog,然后当作子dialog来创建就可以了,页面切换的时候destroy掉一个子dialog,再创建一个新的子dialog。
      

  4.   

    这是我在google上搜CTabCtrl找到的,看人家的回答,多有职业精神。
    网址:
    http://www.experts-exchange.com/Programming/Programming_Languages/MFC/Q_10302200.html1. Create your dialog resource including the list and the tab control and add a picture control with id IDC_STATIC_DUMMY of wanted size and position of the child dialogs within the tab control and remove the 'Visible' style.2. Create the three child dialogs with style 'Child', no border and no caption.3. Create classes for these dialogs, e.g. CTabDlg, CMyDlg1, CMyDlg2, CMyDlg3.4. In CTabDlg do following:
    -add a CTabCtrl member for the tab control with ClassWizard, i.e. m_tab// In header file CTabDlg.h
    #include "MyDlg1.h"
    #include "MyDlg2.h"
    #include "MyDlg3.h"class CTabDlg...
    {
    ...
    CMyDlg1* m_pDlg1;
    CMyDlg2* m_pDlg2;
    CMyDlg3* m_pDlg3;void ShowChild( int id );
    ....
    }// In implementation file CTabDlg.cpp
    // Override OnInitialUpdate()
    BOOL CTabDlg::OnInitDialog() 
    {
    CDialog::OnInitDialog();
          
    // create new dialogs
    m_pDlg1 = new CMyDlg1;
    m_pDlg2 = new CMyDlg2;
    m_pDlg3 = new CMyDlg3;m_pDlg1->Create( CMyDlg1::IDD, this );
    m_pDlg2->Create( CMyDlg2::IDD, this );
    m_pDlg3->Create( CMyDlg3::IDD, this );// position childs
    CRect rect;
    GetDlgItem( IDC_STATIC_DUMMY )->GetWindowRect( rect );
    ScreenToClient( rect );m_pDlg1->MoveWindow( rect );
    m_pDlg2->MoveWindow( rect );
    m_pDlg3->MoveWindow( rect );// insert tab control items
    m_tab.InsertItem( 0, "Dialog 1" );
    m_tab.InsertItem( 1, "Dialog 2" );
    m_tab.InsertItem( 2, "Dialog 3" );ShowChild( 0 );
    return TRUE;
    }void CTabDlg::ShowChild( int id )
    {
    m_pDlg1->ShowWindow( ( id == 0 ) ? SW_SHOW : SW_HIDE );
    m_pDlg2->ShowWindow( ( id == 1 ) ? SW_SHOW : SW_HIDE );
    m_pDlg3->ShowWindow( ( id == 2 ) ? SW_SHOW : SW_HIDE );
    }// add TCN_SELCHANGE notification message handler with ClassWizard
    void CTabDlg::OnSelchangeTab1(NMHDR* pNMHDR, LRESULT* pResult) 
    {
    int id = m_tab.GetCurSel();ShowChild( id );*pResult = 0;
    }// cleanup
    BOOL CTabDlg::DestroyWindow() 
    {
    m_pDlg1->DestroyWindow();     
    delete m_pDlg1;
    m_pDlg2->DestroyWindow();     
    delete m_pDlg2;
    m_pDlg3->DestroyWindow();     
    delete m_pDlg3;return CDialog::DestroyWindow();
    }handle child dialog's data exchange within overriden CTabDlg::OnOK() ...