/// This allows for the window to be moved without having a real border! private void Panel_TitleBar_MouseMove(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Left) { WinAPIComponents.ReleaseCapture(); WinAPIComponents.SendMessage(Handle, WinAPIComponents.WM_NCLBUTTONDOWN, WinAPIComponents.HT_CAPTION, 0); } }
// Allow for dragging around of the form. private void MainFormSmall_MouseMove(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Left) { WinAPIComponents.ReleaseCapture(); WinAPIComponents.SendMessage(Handle, WinAPIComponents.WM_NCLBUTTONDOWN, WinAPIComponents.HT_CAPTION, 0); this.Invalidate(); Program.GDIOverlay.Invalidate(); } }