0

im trying to fix the problem of my code where it has a place it will move but it dose not move like the normal border

bool mousedown;

private void Top_bar_MouseDown(object sender, MouseEventArgs e)
{
  mousedown = true;
}

private void Top_bar_MouseMove(object sender, MouseEventArgs e)
{
  if (mousedown)
   {
     int mousex = MousePosition.X - 200;
     int mousey = MousePosition.Y - 10;
     int form_mousex = System.Windows.Forms.Cursor.Position.X - this.Location.X;
     int form_mousey = System.Windows.Forms.Cursor.Position.Y - this.Location.Y;
     this.SetDesktopLocation(mousex, mousey);
   }
}

private void Top_bar_MouseUp(object sender, MouseEventArgs e)
{
 mousedown = false;
}

it to be like a normal windows application border

Reza Aghaei
  • 120,393
  • 18
  • 203
  • 398

0 Answers0