我在CDialog中添加了一個CMFCTabCtrl。但我的問題是它不可見。這是我用來創建CMFCTabCtrl的代碼。CMialTabCtrl在CDialog中不可見
m_TabControl.Create (CMFCTabCtrl::STYLE_3D, rectTab, this, 1, CMFCTabCtrl::LOCATION_TOP , TRUE);
m_TabControl.ShowWindow(TRUE);
m_wnd1.Create (WS_CHILD | WS_VISIBLE, CRect (0, 0, 100, 100), &m_TabControl, 1);
m_wnd1.SetFont (&afxGlobalData.fontRegular);
m_wnd1.SetWindowText ("Edit 1");
m_wnd2.Create (WS_CHILD | WS_VISIBLE, CRect (0, 0, 0, 0), &m_TabControl, 2);
m_wnd2.SetFont (&afxGlobalData.fontRegular);
m_wnd2.SetWindowText ("Edit 2");
m_wnd3.Create (WS_CHILD | WS_VISIBLE, CRect (0, 0, 0, 0), &m_TabControl, 3);
m_wnd3.SetFont (&afxGlobalData.fontRegular);
m_wnd3.SetWindowText ("Edit 3");
m_wnd4.Create (WS_CHILD | WS_VISIBLE, CRect (0, 0, 0, 0), &m_TabControl, 4);
m_wnd4.SetFont (&afxGlobalData.fontRegular);
m_wnd4.SetWindowText ("Edit 4");
m_TabControl.AddTab (&m_wnd1, "One", 0, TRUE);
m_TabControl.AddTab (&m_wnd2, "Two", 0, FALSE);
m_TabControl.AddTab (&m_wnd3, "Three", 0, FALSE);
m_TabControl.AddTab (&m_wnd4, "Four", 0, FALSE);
我在做什麼錯在這裏/ ...
你做錯的第一件事是,你的代碼中有**絕對沒有錯誤檢查**。當它不像你期望的那樣工作時,這變得很重要。它會精確地告訴你它發生故障的位置,以及指示問題根源的錯誤代碼。 – 2013-05-09 08:06:33