Full Area Mobile
Const intWm_nclbuttondown =0xa1; Const intHt_caption =0x2; [DllImport ("user32.dll")] Static extern intSendMessage (IntPtr hWnd,intMSG,intWParam,intLParam); protected Override voidOnMouseDown (MouseEventArgs e) {if(E.button = =mousebuttons.left) { This. Capture =false; SendMessage (Handle, Wm_nclbuttondown, Ht_caption,0); } Else { This. Close ();//right-click to exit form } }
Title Area move
[DllImport ("user32.dll")] Public Static extern BOOLreleasecapture (); [DllImport ("user32.dll")] Public Static extern BOOLSendMessage (INTPTR hwnd,intWmsg,intWParam,intLParam); Public Const intWm_syscommand =0x0112; Public Const intSc_move =0xf010; Public Const intHtcaption =0x0002; Public voidShapedform_mousedown (Objectsender, MouseEventArgs e) {releasecapture (); SendMessage ( This. Handle, Wm_syscommand, Sc_move + htcaption,0); }