15,978
社区成员
发帖
与我相关
我的任务
分享
void CMyEdit::OnLButtonDown(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
m_bDrag=TRUE;
m_ptOld=point;
SetCapture();
CEdit::OnLButtonDown(nFlags, point);
}
void CMyEdit::OnMouseMove(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
if(m_bDrag)
{
CPoint pt=point;
MapWindowPoints(GetParent(),&pt,1);
CRect rt;
GetClientRect(rt);
SetWindowPos(NULL,pt.x,pt.y,0,0,SWP_NOSIZE);
m_ptOld=point;
}
CEdit::OnMouseMove(nFlags, point);
}
void CMyEdit::OnLButtonUp(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
m_bDrag=FALSE;
CEdit::OnLButtonUp(nFlags, point);
}