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

本文介绍了CXTPTabControl控件的创建过程及其使用方法,包括如何设置外观、位置、图标显示等属性,并提供了插入新标签页的具体实现步骤。此外,还讨论了在特定条件下隐藏标签页的方法。

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




评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值