您的位置:首页 > 编程语言 > PHP开发

CXTPTabControl 使用 ----如何限制tab标签页显示

2012-02-22 14:59 513 查看
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;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: