Improve movement of ui
thALaZy opened this issue · comments
thALaZy commented
when I try to move the ui it stops after about 10 ms here is a video but I have some c# code so it's way smoother:
public const int WM_NCLBUTTONDOWN = 0xA1;
public const int HT_CAPTION = 0x2;
[DllImport("user32.dll")]
public static extern int SendMessage(IntPtr hWnd, int Msg, int wParam, int lParam);
[DllImport("user32.dll")]
public static extern bool ReleaseCapture();
private void FormMoveable_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
{
ReleaseCapture();
SendMessage(Handle, WM_NCLBUTTONDOWN, HT_CAPTION, 0);
}
}
2021-01-11.13-31-24.mp4
Abhishek Bharti commented
This lag happens when we try to drag the window after clicking on "Release/Recover the control of drawing" (above a certain speed). Otherwise its smooth.
Abhishek Bharti commented
Solved