C#无边框拖动代码

        protected override void WndProc(ref Message m)
        {
            if (m.Msg == 163 &&
                this.ClientRectangle.Contains(this.PointToClient(new Point(m.LParam.ToInt32())))
                && m.WParam.ToInt32() == 2)
            {
                m.WParam = (IntPtr)1;
            }
            base.WndProc(ref m);
            if (m.Msg == 132
                && m.Result.ToInt32() == 1)
            {
                m.Result = (IntPtr)2;
            }
        }

 

posted @ 2017-03-28 19:01  sky20080101  阅读(70)  评论(0)    收藏  举报