ghasem deh

ghasem deh

  • NA
  • 258
  • 37.8k

Move form with Mouse_Down

Sep 16 2014 4:04 PM
hi ...
i use this code to move Form with Event Mouse_Down :

[DllImport("user32.dll")]
static extern int ReleaseCapture();
[DllImport("user32.dll", EntryPoint = "SendMessageA")]
static extern int SendMessage(int hwnd, int wMsg, int wParam, object lParam);
private const int WM_NCLBUTTONDOWN = 161;
.
.
.

private void button7_MouseDown(object sender, MouseEventArgs e)
{
ReleaseCapture();
SendMessage(this.Handle.ToInt32(), WM_NCLBUTTONDOWN, 2, 0);
}


But after Mouse_Up ... Error :

http://s5.picofile.com/file/8141136026/Untitl34reed.png