Re: MDI and ShowDialog()

Charlotte Foust <[email protected]> Thu, 13 Dec 2007 16:40:52 -0800
Newsgroups gmane.comp.windows.devel.dotnet.winforms
Message-ID <F55048AF7E974F429BB24597D7355EEA70418F@INFOSERVER04.infostat.local>
Are you talking about opening a popup form or opening a form within the
MDI window?  ShowDialog pops up a dialog so if you want to position it,
you can use the Forms's StartPosition property and set it to
CenterParent.  If you want to open the form within the MDI parent, you
don't open it as a dialog.

Charlotte Foust 

-----Original Message-----
From: Discussion forum for developers using Windows Forms to build apps
and controls [mailto:[email protected]] On Behalf Of
Steve Abaffy
Sent: Thursday, December 13, 2007 4:25 PM
To: [email protected]
Subject: [DOTNET-WINFORMS] MDI and ShowDialog()

After considerable research I cannot find a way to open a form using
ShowDialog() within a MDI parent.

SomeForm SF = new SomeForm(parameters);
SF.MdiParent = MdiParent;
SF.ShowDialog(); - Blows up here with an exception thrown.
Do More Stuff here after form closes

All I have read says that this cannot be done, but I don't believe that.

Any help would be appreciated.

Thanks.