用lanbel移动 FormBorderstyle为None属性窗体的移动
我把窗体FormBorderstyle属性设为了None,这样的话,窗体就移动不了了,所以想用一个Label来控制这个窗体的移动,要怎么弄,谁给个例子啊,以前在VB里看到过,不过忘了,现在刚接触这个
一个Label来控制这个窗体的移动 //怪了,从来没有听说过,也没有见过啊
Borderstyle设置为其它的就好了。
程序代码: [DllImport("user32.dll")]
public static extern bool ReleaseCapture();
[DllImport("user32.dll")]
public static extern bool SendMessage(IntPtr hwnd, int wMsg, int wParam, int lParan);
public const int HTCAPTION = 2;
public const int WM_SYSCOMMAND = 0x112;
public const int SC_MOVE = 0xf010;
添加mousDown事件调用
程序代码: private void Form_MouseDown(object sender, MouseEventArgs e)
{
ReleaseCapture();
SendMessage(base.Handle, 0x112, 0xf012, 0);
}