标签:style blog ar for div log on 代码 c
如题,代码如下:
/// <summary>设置可以鼠标左键让窗体移动的控件 /// </summary> /// <param name="form">待移动的窗体,通常是设置了FormBorderStyle = FormBorderStyle.None的窗体</param> /// <param name="control">能控制窗体左键移动的控件</param> public static void SetMoveFormControl(Form form, Control control) { control.MouseDown += (s, e) => { ReleaseCapture(); SendMessageA((int)form.Handle, 0xa1, 2, 0); }; } [DllImport("user32.dll")] private static extern int ReleaseCapture(); [DllImport("user32.dll")] private static extern int SendMessageA(int hwnd, int wMsg, int wParam, int lParam);
标签:style blog ar for div log on 代码 c
原文地址:http://www.cnblogs.com/bruceleeliya/p/3984253.html