Winform-无边框窗体实现拖动
程序员文章站
2022-07-14 13:02:36
...
#region 实现拖动
private Point mousePoint = new Point();
private void FrmLogin_MouseDown(object sender, MouseEventArgs e)
{
this.mousePoint.X = e.X;
this.mousePoint.Y = e.Y;
}
private void FrmLogin_MouseMove(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
{
this.Top = Control.MousePosition.Y - mousePoint.Y + 13;
this.Left = Control.MousePosition.X - mousePoint.X + 13;
}
}
#endregion
上一篇: 面试题:哔哩哔哩|算法工程师
下一篇: 拖动无边框窗体