我创建了个基于CButton的SButton类,让它动态的创建了几个按钮,在SButton类的内部怎么得到Button类按钮的坐标?
RECT _xy;
this->GetWindowRect(&_xy);
//t.MoveWindow(&_xy);
this->ScreenToClient(&_xy);
CString s;
s.Format("%d %d %d %d ",_xy.bottom,_xy.left,_xy.right,_xy.top);
t->h_dz.SetWindowText(s);
this->MoveWindow(&_xy);我用了这个办法还是不行。坐标总是:23 0 55 0
在SButton类的内部怎么得到Button类按钮的坐标?
RECT _xy;
this->GetWindowRect(&_xy);
//t.MoveWindow(&_xy);
this->ScreenToClient(&_xy);
CString s;
s.Format("%d %d %d %d ",_xy.bottom,_xy.left,_xy.right,_xy.top);
t->h_dz.SetWindowText(s);
this->MoveWindow(&_xy);我用了这个办法还是不行。坐标总是:23 0 55 0
在SButton类的内部怎么得到Button类按钮的坐标?
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货