调用SetWindowPos后,为什么控件位置比给的CRect的位置偏下?

showhigh 2005-11-25 03:36:54
RECT rect,rectSheet;
m_expandWnd.GetWindowRect(&rect);

//加入标签,标签名由各个子对话框的标题栏决定
m_dialTabSheet.AddPage(&m_contactTab);
m_dialTabSheet.AddPage(&m_speedTab);
m_dialTabSheet.AddPage(&m_searchTab);

//用Create来创建一个属性页
m_dialTabSheet.Create(this, WS_CHILD | WS_VISIBLE, WS_EX_CONTROLPARENT);
cout<<"rcMarker:"<<rect.left<<":"<<rect.top<<endl;
//调整属性页的大小和位置
m_dialTabSheet.SetWindowPos(NULL, rect.left,rect.top,0, 0, SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE);
m_dialTabSheet.GetWindowRect(&rectSheet);
cout<<"rectSheet:"<<rectSheet.left<<":"<<rectSheet.top<<endl;
...全文
111 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
cpls 2005-11-26
  • 打赏
  • 举报
回复
窗口坐标和客户区坐标是不一样的
showhigh 2005-11-25
  • 打赏
  • 举报
回复
m_dialTabSheet 是CPropertySheet的对象实例变量
showhigh 2005-11-25
  • 打赏
  • 举报
回复
调用之前,rect.left=344,rect.top=61
调用后,rectSheet.left=347,rectSheet.top=90

7,540

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 VC.NET
社区管理员
  • VC.NET社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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