- protected override void WndProc(ref Message m)
- {
- const int WM_NCHITTEST = 0x84;
- const int HTCLIENT = 0x01;
- const int HTCAPTION = 0x02;
- if (m.Msg == WM_NCHITTEST)
- {
- this.DefWndProc(ref m);
- if (m.Result.ToInt32() == HTCLIENT)
- m.Result = new IntPtr(HTCAPTION);
- else
- base.WndProc(ref m);
- }
- else
- base.WndProc(ref m);
- }
C#中拖拽窗体随意移动代码
最新推荐文章于 2024-01-19 23:58:52 发布