标签:注册 style void info win 事件 rip ini eve
(1)无边框窗口的拖动事件
新建一个MenuStrip,然后注册其MouseMove与MouseDown事件
private Point formPoint = new Point(); public MainForm() { InitializeComponent(); } private void MenuStrip_MouseMove(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Left) { Point myPosition = MousePosition; myPosition.Offset(-formPoint.X, -formPoint.Y); Location = myPosition; } } private void MenuStrip_MouseDown(object sender, MouseEventArgs e) { formPoint.X = e.X; formPoint.Y = e.Y; }
(2)无边框窗口的关闭事件
标签:注册 style void info win 事件 rip ini eve
原文地址:https://www.cnblogs.com/looori/p/13401354.html