日期:2014-05-18 浏览次数:20925 次
public partial class LoginForm : Form { private const int WM_NCHITTEST = 0x0084; private const int HTCAPTION = 0x0002; protected override void WndProc(ref Message m) { switch (m.Msg) { case WM_NCHITTEST: m.Result = (IntPtr)HTCAPTION; //模拟标题栏,移动或双击可以最大或最小化窗体 break; default: base.WndProc(ref m); break; } }