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

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;
		}




你可能感兴趣的:(null,delete,output)