[DllImport("user32.dll")]//*********************拖动无窗体的控件
public static extern bool ReleaseCapture();
[DllImport("user32.dll")]
public static extern bool SendMessage(IntPtr hwnd, int wMsg, int wParam, int lParam);
public const int WM_SYSCOMMAND = 0x0112;
public const int SC_MOVE = 0xF010;
public const int HTCAPTION = 0x0002;
//需添加using System.Runtime.InteropServices;
[DllImport("user32.dll")]
public static extern bool ReleaseCapture();
[DllImport("user32.dll")]
public static extern bool SendMessage(IntPtr hwnd, int wMsg, int wParam, int lParam);
//常量
public const int WM_SYSCOMMAND = 0x0112;
//窗体移动
public const int SC_MOVE = 0xF010;
public const int HTCAPTION = 0x0002;
private const int WM_SYSCOMMAND = 0x0112;//点击窗口左上角那个图标时的系统信息
private const int SC_MOVE = 0xF010;//移动信息
private const int HTCAPTION = 0x0002;//表示鼠标在窗口标题栏时的系统信息
private const int WM_NCHITTEST = 0x84;//鼠标在窗体客户区(除了标题栏和边框以外的部分)时发送的消息
private const int HTCLIENT = 0x1;//表示鼠标在窗口客户区的系统消息
private const int SC_MAXIMIZE = 0xF030;//最大化信息
private const int SC_MINIMIZE = 0xF020;//最小化信息
//改变窗体大小
public const int WMSZ_LEFT = 0xF001;
public const int WMSZ_RIGHT = 0xF002;
public const int WMSZ_TOP = 0xF003;
public const int WMSZ_TOPLEFT = 0xF004;
public const int WMSZ_TOPRIGHT = 0xF005;
public con