我新建一标签,想对其进行移动:
Label内: [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; protected override void OnMouseDown(MouseEventArgs e)
{
ReleaseCapture();
SendMessage(this.Handle, WM_SYSCOMMAND, SC_MOVE + HTCAPTION, 0);
base.OnMouseDown(e);
}然后我重载其doubleclick方法,发现我虽然对其双击,但不执行! protected override void OnDoubleClick(EventArgs e)
{
CustUserCtrl custCtrl = new CustUserCtrl();
custCtrl.Left = this.Left;
custCtrl.Top = this.Top + this.Height - 3;
this.Controls.Add(custCtrl);
base.OnDoubleClick(e);
}
请问是什么原因啊?
Label内: [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; protected override void OnMouseDown(MouseEventArgs e)
{
ReleaseCapture();
SendMessage(this.Handle, WM_SYSCOMMAND, SC_MOVE + HTCAPTION, 0);
base.OnMouseDown(e);
}然后我重载其doubleclick方法,发现我虽然对其双击,但不执行! protected override void OnDoubleClick(EventArgs e)
{
CustUserCtrl custCtrl = new CustUserCtrl();
custCtrl.Left = this.Left;
custCtrl.Top = this.Top + this.Height - 3;
this.Controls.Add(custCtrl);
base.OnDoubleClick(e);
}
请问是什么原因啊?
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货