请教tab控件的问题

wwwhhb4005 2011-02-15 02:23:00
m_tab.InsertItem(0,"项目一");
m_tab.InsertItem(1,"项目二");
m_tab.InsertItem(2,"项目三");

m_para1.Create(IDD_PARA1,GetDlgItem(IDC_TABTEST));
m_para2.Create(IDD_PARA2,GetDlgItem(IDC_TABTEST));
m_para3.Create(IDD_PARA3,GetDlgItem(IDC_TABTEST));

CRect rs;
m_tab.GetClientRect(&rs);

CString string;

rs.top=rs.top+60;
string.Format("%f",rs.top);
MessageBox(string);

rs.bottom=rs.bottom-1;
string.Format("%f",rs.bottom);
MessageBox(string);

rs.left=rs.left-1;
string.Format("%f",rs.bottom);
MessageBox(string);

rs.right=rs.right-1;
string.Format("%f",rs.bottom);
MessageBox(string);

m_para1.MoveWindow(&rs);
m_para2.MoveWindow(&rs);
m_para3.MoveWindow(&rs);

m_para1.ShowWindow(true);
m_para2.ShowWindow(false);
m_para3.ShowWindow(false);

m_tab.SetCurSel(0);


================================

m_tab.GetClientRect(&rs);

为什么GetClientRect()得到的矩形顶底左右都是0呀,请教?
...全文
77 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
Eleven 2011-02-15
  • 打赏
  • 举报
回复
你上面的代码是在哪里调用的呢?

15,978

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 界面
社区管理员
  • 界面
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧