Center form on parent form

G

Guest

I have an application with a main form (size 300, 200) and I added another
form to the project. I would like to set the second form to center on the
main form. I have tried setting the parent of the second form to be the
first form using:

this.Parent = Form1; (both with and without the ( ))

but that doesn't work, otherwise I could set the CentreParent property for
Form2. I also tried adding the following to the constructor of Form1:

Form2 fm2 = new Form2();
fm2.Parent = this;

Still won't work.

Any ideas?
 
L

Lord2702

Overload the form Layout evnt, and implement the proper logic to center to
one another form.

Good Luck.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top