移动无标题窗体
来源:互联网 发布:matlab 矩阵中最小值 编辑:程序博客网 时间:2024/05/04 11:39
1. const int WM_NCHITTEST = 0x0084;
const int HTCLIENT = 0x0001;
const int HTCAPTION = 0x0002;
protected override void WndProc(ref System.Windows.Forms.Message m)
{
switch(m.Msg)
{
case WM_NCHITTEST:
base.WndProc(ref m);
if (m.Result==(IntPtr)HTCLIENT)
m.Result=(IntPtr)HTCAPTION;
break;
default:
base.WndProc(ref m);