How would it be possible to spawn a new form e.g. Form2
from Form1
, but make sure Form2
is adjacent to Form1
, for example:
Something like:
// button click handler method
Form2 child = new Form2();
child.Location = new Point(this.Location.X + this.Width,
this.location.Y);
child.Show();
Take the X coordinate of the location of the current form object and add to it the width of the form, thus obtaining the X coordinate of the new form. The Y coordinate stays the same.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With