Const intHtleft =Ten;Const intHtright = One;Const intHttop = A;Const intHttopleft = -;Const intHttopright = -;Const intHtbottom = the;Const intHtbottomleft =0x10;Const intHtbottomright = -;protected Override voidWndProc (refMessage m) { Switch(m.msg) { Case 0x0084: Base. WndProc (refm); Point Vpoint=NewPoint (int) m.LParam &0xFFFF, (int) m.LParam >> -&0xFFFF); Vpoint=pointtoclient (Vpoint); if(Vpoint.x <=5) if(Vpoint.y <=5) M.result=(INTPTR) httopleft; Else if(Vpoint.y >= Clientsize.height-5) M.result=(INTPTR) htbottomleft; ElseM.result =(INTPTR) htleft; Else if(Vpoint.x >= Clientsize.width-5) if(Vpoint.y <=5) M.result=(INTPTR) httopright; Else if(Vpoint.y >= Clientsize.height-5) M.result=(INTPTR) htbottomright; ElseM.result =(INTPTR) htright; Else if(Vpoint.y <=5) M.result=(INTPTR) httop; Else if(Vpoint.y >= Clientsize.height-5) M.result=(INTPTR) Htbottom; Break; Case 0x0201://left mouse button pressed messageM.msg =0x00A1;//change a message to a non-client area by pressing the mousem.LParam = IntPtr.Zero;//Default ValueM.wparam =NewINTPTR (2);//the mouse is placed in the title bar Base. WndProc (refm); Break; default: Base. WndProc (refm); Break; }}
C # Ways to change the size of a borderless form