private void Form1_MouseDown(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Left) { WinFormHelper.ReleaseCapture(); WinFormHelper.SendMessage(Handle, WinFormHelper.WmNclbuttondown, WinFormHelper.HtCaption, 0); } else if (e.Button == MouseButtons.Right) { ctxMenu.Visible = true; ctxMenu.Location = MousePosition; } }