protected override void WndProc(ref Message message) { if (!AllowDrag) { switch (message.Msg) { case WM_SYSCOMMAND: int command = message.WParam.ToInt32() & 0xfff0; if (command == SC_MOVE) return; break; } } base.WndProc(ref message); }