In C # WinForm, the border does not appear to cause the form can not be dragged, the bottom of the code to add up can be resolved.
1. Import namespaces
Using System.Runtime.InteropServices;
2. Enter the following code
[DllImport ("User32.dll")]
public static extern bool ReleaseCapture ();
[DllImport ("User32.dll")]
public static extern bool SendMessage (INTPTR hwnd, int wmsg, int wParam, int lParam);
private void Picturebox2_click (object sender, EventArgs e)
{
Application.exit ();
}
private void Picturebox4_click (object sender, EventArgs e)
{
This. WindowState = formwindowstate.minimized;
}
Write the following code in the MouseDown event of the form
private void Zcmmform_mousedown (object sender, MouseEventArgs e)
{
if (E.button = = MouseButtons.Left)
{
ReleaseCapture (); SendMessage (Handle, 0xa1, 0x02, 0);
}
}
An issue in which a form cannot be dragged after it has been removed
In C # WinForm, the border does not appear to cause the form can not be dragged, the bottom of the code to add up can be resolved.