privatevoidfrmDrag_Paint(object sender, PaintEventArgs e){//Draws a border to make the Form stand out//Just done for appearance, not necessary Pen p =new Pen(Color.Gray,3);e.Graphics.DrawRectangle(p,0,0,this.Width-1,this.Height-1);p.Dispose();}Point lastClick;//Holds where the Form was clickedprivatevoidfrmDrag_MouseDown(object sender, MouseEventArgs e){lastClick=new Point(e.X,e.Y);//We'll need this for when the Form starts to move}privatevoidfrmDrag_MouseMove(object sender, MouseEventArgs e){//Point newLocation = new Point(e.X - lastE.X, e.Y - lastE.Y);if(e.Button==MouseButtons.Left)//Only when mouse is clicked{//Move the Form the same difference the mouse cursor moved;this.Left+=e.X-lastClick.X;this.Top+=e.Y-lastClick.Y;}}//If the user clicks on the label we want the same kind of behavior//so we just call the Forms corresponding methodsprivatevoidlabel1_MouseDown(object sender, MouseEventArgs e){frmDrag_MouseDown(sender,e);}privatevoidlabel1_MouseMove(object sender, MouseEventArgs e){frmDrag_MouseMove(sender,e);}