MdiParent Question

J

Jassim Rahma

I have a dialog form and appears on the top of MDIContainer (frmMain)
and I want when the user close the dialog form then an MDIChild should
be open on the frmMain. I tried:

myMDIChild.MdiParent = frmMain();


but it didn't work.. I also tried:


frmMain MainForm = new frmMain();
myMDIChild.MdiParent = MainForm;


with no luck. I am not getting any error message but the MDIChild form
is not openning..




Many Thanks,
Jassim Rahma
 
O

Ollie Riches

you are not calling .Show() after setting the MdiParent property, so in the
examples given you need to

myMDIChild.MdiParent = frmMain();
myMDIChild.Show();


--
HTH

Ollie Riches
http://www.phoneanalyser.net


Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a programmer
helping programmers.
 
S

Slawek Weclewski

I have a dialog form and appears on the top of MDIContainer (frmMain)
and I want when the user close the dialog form then an MDIChild should
be open on the frmMain. I tried:

myMDIChild.MdiParent = frmMain();


but it didn't work.. I also tried:


frmMain MainForm = new frmMain();
myMDIChild.MdiParent = MainForm;


with no luck. I am not getting any error message but the MDIChild form
is not openning..

I don`t understand your thinking. It`s better that you send us a hole code.
Maybe... myMDIChild.Show();
 
J

Jassim Rahma

I am already calling Show() but sorry i forgot to paste it in my post.



Many Thanks,
Jassim Rahma
 

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