1,CXTPTabControl 创建方法
if (!m_wndTabs.Create (WS_CHILD|WS_VISIBLE|WS_CLIPCHILDREN|WS_CLIPSIBLINGS, rectDummy, this, IDC_TABCTROL))
{
TRACE0("Failed to create output tab window\n");
return false; // fail to create
}
m_wndTabs.GetPaintManager()->SetAppearance(xtpTabAppearanceVisualStudio2005/*xtpTabAppearancePropertyPage2003*/);
m_wndTabs.GetPaintManager()->m_bHotTracking = TRUE;
m_wndTabs.GetPaintManager()->m_bShowIcons = TRUE;
m_wndTabs.GetPaintManager()->SetPosition(xtpTabPositionBottom);
m_wndTabs.GetPaintManager()->DisableLunaColors(/*FALSE*/TRUE);2.使用方式:
if(!pNewWnd->Create(NULL, NULL, WS_CHILD | WS_VISIBLE, rectDummy,&m_wndTabs,IDC_PAGEWND, &cc))
{
delete pNewWnd ;
pNewWnd = NULL;
return;
}
pGridWnd->SetOwner(this);
m_wndTabs.InsertItem(i, "新建标签页", pNewWnd->GetSafeHwnd());
3.处理标签页显示控制
if (1 == iTotalPages) //只有一个page时不显示tab页,避免跟主窗口的重复显示
{
m_wndTabs.GetPaintManager()->m_bShowTabs = FALSE;
}
本文介绍了CXTPTabControl控件的创建过程及其使用方法,包括如何设置外观、位置、图标显示等属性,并提供了插入新标签页的具体实现步骤。此外,还讨论了在特定条件下隐藏标签页的方法。

4437

被折叠的 条评论
为什么被折叠?



