How to drag a WinForm without a title bar form, winform title bar
Change the form name to Form_HoverTree.
Download the source code.
Main Code:
Point _ HoverTreePosition; public Form_HoverTree () {InitializeComponent (); _ HoverTreePosition = new Point ();} /// <summary> /// record the start position of the mouse, hovertree.com // </summary> private void Form_HoverTree_MouseDown (object sender, MouseEventArgs e) {_ HoverTreePosition. X = e. x; _ HoverTreePosition. Y = e. Y ;}/// <summary> /// hold down the left button and move the mouse over the form.-Why? // </summary> private void Form_HoverTree_MouseMove (object sender, MouseEventArgs e) {if (e. button = MouseButtons. left) {Point h_myPosittion = MousePosition; h_myPosittion.Offset (-_ HoverTreePosition. x,-_ HoverTreePosition. y); Location = h_myPosittion ;}}
:
It can be seen that this form is a custom form with no title bar. Reference: http://hovertree.com/h/bjaf/52nadvt4.htm
Download source code:
Http://hovertree.com/h/bjaf/j4wwteu3.htm