如何移动没有Title的窗体。
1 private void label1_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
2 {
3 mouse_offset = new Point(-e.X, -e.Y);
4 }
5
6 private void label1_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e)
7 {
8 if (e.Button == MouseButtons.Left)
9 {
10 Point mousePos = Control.MousePosition;
11 mousePos.Offset(mouse_offset.X, mouse_offset.Y);
12 Location = mousePos;
13 }
14 }
2 {
3 mouse_offset = new Point(-e.X, -e.Y);
4 }
5
6 private void label1_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e)
7 {
8 if (e.Button == MouseButtons.Left)
9 {
10 Point mousePos = Control.MousePosition;
11 mousePos.Offset(mouse_offset.X, mouse_offset.Y);
12 Location = mousePos;
13 }
14 }