I set the border in the form to null/none so now I can't move the form.. So I found this code which is not firring because my whole form is made of panels:
private bool dragging = false;
private Point dragCursorPoint;
private Point dragFormPoint;
private void HomeScreen_MouseDown(object sender, MouseEventArgs e)
{
dragging = true;
dragCursorPoint = Cursor.Position;
dragFormPoint = this.Location;
}
private void HomeScreen_MouseMove(object sender, MouseEventArgs e)
{
if (dragging)
{
Point dif = Point.Subtract(Cursor.Position, new Size(dragCursorPoint));
this.Location = Point.Add(dragFormPoint, new Size(dif));
}
}
private void HomeScreen_MouseUp(object sender, MouseEventArgs e)
{
dragging = false;
}
HomeScreen Form Mouse Event are not firring because the Form is filled with panels. So somehow I should link the panel clicks to the form clicks (mouse event). Is there a way to do that so I can move my form from wherever I want too?