资源简介
CtabSheet源代码 可以很方便的使用tab控件创建属性页,具体的过程可参考
http://www.vckbase.com/document/viewdoc/?id=398

代码片段和文件信息
//#include “StdAfx.h“
//#include “TabSheet.h“
//
//TabSheet::TabSheet(void)
//{
//}
//
//TabSheet::~TabSheet(void)
//{
//}
// TabSheet.cpp : implementation file
//
#include “stdafx.h“
#include “TabSheet.h“
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CTabSheet
CTabSheet::CTabSheet()
{
//m_nNumOfPages = 0;
m_nCurrentPage = 0;
m_bHideTab=FALSE;
}
CTabSheet::~CTabSheet()
{
m_arrayStatusTab.RemoveAll();
m_pPages.RemoveAll();
m_IDD.RemoveAll();
m_title.RemoveAll();
}
BEGIN_MESSAGE_MAP(CTabSheet CTabCtrl)
//{{AFX_MSG_MAP(CTabSheet)
ON_WM_LBUTTONDOWN()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CTabSheet message handlers
//将字符串从半角转到全角(bDBC=FALSE)或从全角转到半角(bDBC=TRUE)
CString strConv(const CString& strIn BOOL bDBC /* = TRUE*/)
{
CString strTmp = strIn;
LPTSTR szText;
if(!strTmp.IsEmpty())
{
szText = strTmp.GetBuffer(0);
size_t nLen = _tcslen(szText);
if(bDBC)
{
for(size_t i=0;i {
if(12288==szText[i])
szText[i] = 32;
else
{
if(szText[i]>65280 && szText[i]<65375)
szText[i] -= 65248;
}
}
}
else
{
for(size_t i=0;i {
if(32==szText[i])
szText[i] = 12288;
else
{
if(szText[i]<127)
szText[i] += 65248;
}
}
}
strTmp.ReleaseBuffer();
}
return strTmp;
}
BOOL CTabSheet::AddPage(LPCTSTR title CDialog *pDialog UINT ID int nImage)
{
int iIndex = static_cast( m_pPages.Add(pDialog) );
m_IDD.Add(ID);
//m_title.Add(title);
m_title.Add(strConv(titleFALSE));//将标签的标题字符串全部转化成全角字符,以便标签在左或右时标题能够竖直排列
m_pPages[iIndex]->Create( m_IDD[iIndex] this );
InsertItem( iIndex m_title[iIndex] nImage );
SetRect(iIndex);
m_pPages[iIndex]->ShowWindow(iIndex ? SW_HIDE : SW_SHOW);
//** the initial status is enabled
m_arrayStatusTab.Add(TRUE);
return TRUE;
}
void CTabSheet::SetRect(int iIndex)
{
ASSERT(iIndex < m_pPages.GetCount());
CRect tabRect itemRect;
int nX nY nXc nYc;//左、顶、宽、高
GetClientRect(&tabRect);//获取整个TAB控件的位置大小。
GetItemRect(0 &itemRect);//item指的只是标签页,因此这里是获得标签页的位置大小
if (m_bHideTab)
{
nX=tabRect.left;//使用tabRect.left、tabRect.top即可将各页显示的子对话框遮住TAB控件的标签。
nY=tabRect.top;
nXc=tabRe
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 11466 2009-09-08 22:04 CTabSheet\TabSheet.cpp
文件 2420 2009-09-08 22:04 CTabSheet\TabSheet.h
目录 0 2012-04-20 10:44 CTabSheet\
相关资源
- Windows异步套接字网络编程
- VC 获得文件属性 获取文件的创建时
- 基于MVC模式的会员管理系统
- silicon lab公司的收音IC SI47XX全套开发工
- 读者写者问题(读者优先,写者优先
- MFC程序-碰撞的小球
- vc 柱形图 CBarChart
- 用vc 写的导线测量,针对刚学测绘的
- 用VC 编写的仿QQ聊天室程序源代码
- 栅栏填充算法源码(VC)
- 简单的房屋租赁系统
- .net网站服装销售系统(MVC)
-
ob
jectARX给Auto CAD加工具条 - blowfish的vc2008工程.rar
- 画图程序MFC/VC/VC CRectTracker 串行化
- capon波束形成算法-VC实现
- 读取串口数据并画实时曲线的VC 程序
- VC 游戏编程—附源代码
- IpHlpApi.h&IpHlpApi.lib
- vc 6.0开发的流程图编辑器
- VC 天空盒(skyBox)实现(附源代码)
- c MFC 画多边形
- keil vcom windows 7 64bit 驱动
- vc URL编解码类
- vc编写中国象棋详细源码注释并附有视
- VC 围棋源代码
- 用VC 编写的基于SNMP的路由器拓扑程序
- vc利用MFC底层开发的二维GIS管理软件,
- 兰勃托地图投影VC源码
- 清华大学郑莉C 语言程序设计课件
评论
共有 条评论