鼠标可拖动窗体
<div id="cnblogs_post_body">using System.Runtime.InteropServices;
http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif public static extern IntPtr SendMessage(IntPtr hWnd, int msg, int wparam, int lparam);
private void menuStrip2_MouseDown(object sender, MouseEventArgs e)
{
base.OnMouseDown(e);
if (e.Button == MouseButtons.Left)//按下的是鼠标左键
{
Capture = false;//释放鼠标,使能够手动操作
SendMessage(Handle, 0x00A1, 2, 0);//拖动窗体
}
}
页:
[1]