MDI Parent won't let child maximise

C

creamBoy

Guys, this is very annoying. I'm almost at completion of this project
and i'm still stuck. I declare a form object and add it to the MDI
form,
ChildForm childFormObj = new ChildForm();
childFormObj.MdiParent = this;
childFormObj.Show();
Then i maximise it, childFormObj.WindowState =
FormWindowState.Maximized;

Even in the child form its window state is already maximised. but it
just won't comply.
What do i do, Please
 
Z

zacks

Guys, this is very annoying. I'm almost at completion of this project
and i'm still stuck. I declare a form object and add it to the MDI
form,
ChildForm childFormObj = new ChildForm();
childFormObj.MdiParent = this;
childFormObj.Show();
Then i maximise it, childFormObj.WindowState =
FormWindowState.Maximized;

Even in the child form its window state is already maximised. but it
just won't comply.
What do i do, Please

I've written two applications that do exactly what you are trying to
do.

Not sure what is exactly causing your problem, but I can tell you that
the only real difference in the way you are trying to do it and the
way it works for me is that I set the child form's windowstate
property before I show it.
 
A

Ayoub Ahmed

add this code in the Form_load method of child form

this.Dock = DockStyle.Fill;
 

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