CMFCTabCtrl [英] CMFCTabCtrl
问题描述
我需要在SDI MFC应用程序中使用选项卡控件.我在CMainFrame中创建了它: nCreate函数:
CRect rect;
GetClientRect(& rect);
if(!m_wndTabCtrl.Create(CMFCTabCtrl: TYLE_3D_ONENOTE,rect,this,-1,CMFCTabCtrl :: LOCATION_TOP,FALSE)) //无法创建
}
m_wndTabCtrl.EnableActiveTabCloseButton(FALSE);
现在在每个选项卡中,我将放置一个自己创建的对话框.我的问题是我的对话框要使用哪个基类(CFormView?).以及如何将它们放置在第一个选项卡的"CMFCBaseTabCtrl :: InsertTab()"选项卡视图中,其余的如何放置在其余选项的"CMFCBaseTabCtrl :: AddtTab()"视图中?
Hi I need to use tab control in SDI MFC application. I created it in CMainFrame:nCreate function:
CRect rect;
GetClientRect(&rect);
if(!m_wndTabCtrl.Create(CMFCTabCtrl:TYLE_3D_ONENOTE,rect,this,-1,CMFCTabCtrl::LOCATION_TOP,FALSE))
{
TRACE0("Failed to create Tab ctrl\n");
return -1; // fail to create
}
m_wndTabCtrl.EnableActiveTabCloseButton(FALSE);
m_wndTabCtrl.EnableInPlaceEdit(FALSE);
m_wndTabCtrl.SetImageList (IDB_PROGRAMS_SMALL, 16, RGB (255, 0, 255));
Now in each tab I would place a dialog of my own creation. My question is which base class to use for my dialogs (CFormView?). And how to place them in tab view 'CMFCBaseTabCtrl::InsertTab()' for first tab and after that 'CMFCBaseTabCtrl::AddtTab()' for the rest?
Thanks!
推荐答案
您好.
您是否解决了这个问题?
由于AddTab将CWnd作为参数,因此我猜测这可以是CDialog派生的类.
Coleman
Hello.
Did you ever resolve this?
Since AddTab takes a CWnd as a parameter, my guess is that this can be a CDialog derived class.
Coleman
这篇关于CMFCTabCtrl的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!