Paste in the custom control or form code
Const int htleft = 10; <br/> const int htright = 11; <br/> const int httop = 12; <br/> const int httopleft = 13; <br/> const int httopright = 14; <br/> const int htbottom = 15; <br/> const int htbottomleft = 0x10; <br/> const int htbottomright = 17; </P> <p> protected override void wndproc (ref message m) <br/>{< br/> switch (M. MSG) <br/>{< br/> case 0x0084: <br/> base. wndproc (ref m); <br/> point vpoint = new point (INT) M. lparam & 0 xFFFF, <br/> (INT) M. lparam> 16 & 0 xFFFF); <br/> vpoint = pointtoclient (vpoint); <br/> If (vpoint. x <= 5) <br/> If (vpoint. Y <= 5) <br/> M. result = (intptr) httopleft; <br/> else if (vpoint. y> = clientsize. height-5) <br/> M. result = (intptr) htbottomleft; <br/> else M. result = (intptr) htleft; <br/> else if (vpoint. x> = clientsize. width-5) <br/> If (vpoint. Y <= 5) <br/> M. result = (intptr) httopright; <br/> else if (vpoint. y> = clientsize. height-5) <br/> M. result = (intptr) htbottomright; <br/> else M. result = (intptr) htright; <br/> else if (vpoint. Y <= 5) <br/> M. result = (intptr) httop; <br/> else if (vpoint. y> = clientsize. height-5) <br/> M. result = (intptr) htbottom; <br/> break; <br/> case 0x0201: // message that is left-clicked <br/> M. MSG = 0x00a1; // change the message to a non-customer zone by pressing the mouse <br/> M. lparam = intptr. zero; // default value <br/> M. wparam = new intptr (2); // place the cursor in the title bar <br/> base. wndproc (ref m); <br/> break; <br/> default: <br/> base. wndproc (ref m); <br/> break; <br/>}< br/>}
From: http://www.cnblogs.com/jiangshui/archive/2010/01/11/1644393.html
I'm afraid I cannot find it again. Reprinted. Pai_^