corning
2
Q:

drag form in C# winform

[DllImport("user32")]
private static extern bool ReleaseCapture();

[DllImport("user32")]
private static extern int SendMessage(IntPtr hWnd, int Msg, int wp, int lp);

protected override void OnMouseDown(MouseEventArgs e)
{
  	base.OnMouseDown(e);
	if (e.Button == MouseButtons.Left)
    {
    	ReleaseCapture();
      	SendMessage(Handle, 161, 2, 0);
    }
}
2

New to Communities?

Join the community