public Application() { InitializeComponent(); int style = NativeWinAPI.GetWindowLong(this.Handle, NativeWinAPI.GWL_EXSTYLE); style |= NativeWinAPI.WS_EX_COMPOSITED; NativeWinAPI.SetWindowLong(this.Handle, NativeWinAPI.GWL_EXSTYLE, style); }
// Move the form with LMB private void Application_MouseDown(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Left) { NativeWinAPI.ReleaseCapture(); NativeWinAPI.SendMessage(Handle, NativeWinAPI.WM_NCLBUTTONDOWN, NativeWinAPI.HT_CAPTION, 0); } }