winform无边框窗体拖动

2021-06-19 22:03

阅读:342

标签:for   orm   void   this   obj   end   ati   oca   sem   

#region 无边框窗体拖动

//获取当前鼠标坐标

private Point mPoint;

private void lbl_Title_MouseDown(object sender,MouseEventArgs e)

{

mPoint=e.Location;

}

private void lbl_Title_MouseMove(object sender,MouseEventArgs e)

{

//左键拖动

if(e.Button==MouseButtons.Left)

{

//窗体当前坐标

this.Locatin=new  Point(this.Location.X+e.X-mPoint.X,this.Location.y+e.Y-mPoint.Y);

}

}

#endregion

winform无边框窗体拖动

标签:for   orm   void   this   obj   end   ati   oca   sem   

原文地址:https://www.cnblogs.com/z55w/p/14902388.html


评论


亲,登录后才可以留言!