winForm单击用户区可移动窗体,代码控制窗体最大适中
protected override void WndProc(ref System.Windows.Forms.Message m)//zhaosn
{
base.WndProc(ref m);
if (m.Msg == 132)
{
if ((IntPtr)1 == m.Result)
{
m.Result = (IntPtr)2;
}
}
}
this.WindowState = FormWindowState.Normal;
this.WindowState = FormWindowState.Maximized;