A. Borderless form
1. How to make the control button
is to place a clickable control, not limited to the use of buttons or anything else,
As long as you can click to trigger the Click event.
Do a little better, is the mouse move in, move out, press three events will let the button change style
How to get the relative path of a picture
Application.startuppath + "\ \". \\.. \\images\\btn_close_highlight.png "
\.. \ folder name ... Turn up a folder
2. How to make a form move
Calling the form to move the API
If there are other controls covering the form, then write the event delegate on the mouse down to
//Form Mobile API[DllImport ("user32.dll")] Public Static extern BOOLreleasecapture (); [DllImport ("user32.dll")] Public Static extern BOOLSendMessage (INTPTR hwnd,intWmsg,intWParam,intIparam); Public Const intWm_syscommand =0x0112; Public Const intSc_move =0xf010; Public Const intHtcaption =0x0002; [DllImport ("User32")] Private Static extern intSendMessage (INTPTR hwnd,intWmsg,intWParam, IntPtr lParam); Private Const intWm_setredraw =0xB; Private voidForm1_mousedown (Objectsender, MouseEventArgs e) { if( This. WindowState = =formwindowstate.normal) {releasecapture (); SendMessage ( This. Handle, Wm_syscommand, Sc_move + htcaption,0); } }
3. How to make a form shaded
//form two-side shadow Public Partial classForm1:form//form's Class { Private Const intCs_dropshadow =0x20000; Private Const intGcl_style = (- -); [DllImport ("user32.dll", CharSet =CharSet.Auto)] Public Static extern intSetclasslong (INTPTR hwnd,intNIndex,intDwnewlong); [DllImport ("user32.dll", CharSet =CharSet.Auto)] Public Static extern intGetclasslong (INTPTR hwnd,intNIndex); PublicForm1 ()//the constructor of the form itself{InitializeComponent ();//constructor Self-signed statementSetclasslong ( This. Handle, Gcl_style, Getclasslong ( This. Handle, Gcl_style) |Cs_dropshadow); } }
Form four-sided shadows: http://bbs.csdn.net/topics/390069539?page=1#post-395227949
Second, the Timer control simple communication
Timer in the component:
Enabled-whether this control is enabled
Interval-interval time, milliseconds
Tick event-code snippet to execute after a specified time interval
A timer is a thread that, by default, can access objects across threads
WinForm no border form and timer control