MFC 之Tab控件使用

来源:互联网 发布:python编写程序 示范 编辑:程序博客网 时间:2024/05/29 14:01

 CRect childRect;

 m_Tab.GetWindowRect(&childRect);
 ScreenToClient(&childRect);
 
 childRect.top += 20;
 childRect.left += 1;

 childRect.bottom += 20;
 childRect.right += 1;

 m_1Dlg.Create(IDD_REAL_TIME_TEMP1_DIALOG,this);

 m_1Dlg.MoveWindow(&childRect);

 m_2Dlg.Create(IDD_REAL_TIME_TEMP2_DIALOG, this);
 m_2Dlg.MoveWindow(&childRect);

 m_Tab.SetCurSel(0);
 m_1Dlg.ShowWindow(SW_SHOW);
 m_2Dlg.ShowWindow(SW_HIDE);

 

子对话框的属性:

Border :None

Style:  Child

 

如何需要切换Tab控件,必须在消息函数OnTcnSelchange进行操作。