I\'ve main form when I press btn I open new form with showDialog() function, I need to move two forms together when I press on main form, because they share in design. how
The main ingredients are the forms' Top
, Left
, Location
, and Width
properties. Say you have a reference to both forms, called form1
and form2
. You could reposition windows like so:
form2.Location = new Point(form1.Left + form1.Width, form1.Top);
The result is both forms, top aligned, with form2 on the right.
Reference:
http://msdn.microsoft.com/en-us/library/aa984420.aspx