Hello, for a long time using several methods, I will give the code below. Perhaps there is a more humane solution to this problem, share the code.
[DllImport("user32", CharSet = CharSet.Auto)] internal extern static bool PostMessage(IntPtr hWnd, uint Msg, uint WParam, uint LParam); [DllImport("user32", CharSet = CharSet.Auto)] internal extern static bool ReleaseCapture(); const uint WM_SYSCOMMAND = 0x0112; const uint DOMOVE = 0xF012; const uint DOSIZE = 0xF008; And we insert into the MouseDown event of the control. code.
ReleaseCapture(); PostMessage(this.Handle, WM_SYSCOMMAND, DOMOVE, 0); This option works fine, without lags, and flicker, maybe there is a better solution?