windows窗体 窗口固定问题
要求不用窗体属性,用一段代码把窗体固定,不让用户拖动窗口。求大牛解答。。
private const int WM_NCHITTEST = 0x84; private const int HTCLIENT = 0x1; private const int HTCAPTION = 0x2; protected override void WndProc(ref Message m) { switch (m.Msg) { case WM_NCHITTEST: base.WndProc(ref m); if ((int)m.Result == HTCAPTION) m.Result = (IntPtr)HTCLIENT; return; } base.WndProc(ref m); }