vc当中关于控件调整大小
voidCNewButton::OnMouseMove(UINTnFlags,CPointpoint){//TODO:Addyourmessagehandlercodeh...
void CNewButton::OnMouseMove(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
CRect rect;
GetDlgItem(IDC_BUTTON1)->GetWindowRect(&rect);
if (rect.top==288)
{
GetDlgItem(IDC_BUTTON1)->SetWindowPos(NULL,577,588,0,0,SWP_NOZORDER|SWP_NOSIZE);
GetDlgItem(IDC_BUTTON1)->GetWindowRect(&rect);
}
else
{
GetDlgItem(IDC_BUTTON1)->SetWindowPos(NULL,577,288,0,0,SWP_NOZORDER|SWP_NOSIZE);
GetDlgItem(IDC_BUTTON1)->GetWindowRect(&rect);
}
CButton::OnMouseMove(nFlags, point);
}
就是想鼠标移过去,BUTTON就改变位置,可是一运行就出现错误,
就是当把鼠标移上去的时候,出现错误 展开
{
// TODO: Add your message handler code here and/or call default
CRect rect;
GetDlgItem(IDC_BUTTON1)->GetWindowRect(&rect);
if (rect.top==288)
{
GetDlgItem(IDC_BUTTON1)->SetWindowPos(NULL,577,588,0,0,SWP_NOZORDER|SWP_NOSIZE);
GetDlgItem(IDC_BUTTON1)->GetWindowRect(&rect);
}
else
{
GetDlgItem(IDC_BUTTON1)->SetWindowPos(NULL,577,288,0,0,SWP_NOZORDER|SWP_NOSIZE);
GetDlgItem(IDC_BUTTON1)->GetWindowRect(&rect);
}
CButton::OnMouseMove(nFlags, point);
}
就是想鼠标移过去,BUTTON就改变位置,可是一运行就出现错误,
就是当把鼠标移上去的时候,出现错误 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询