Well that is what I am already doing already. What I'm using the MDI
child forms for is say there is a button on every tabpage that will
result in a form being activated. i wanted to use MDI children so that
only one of these forms could be shown at a time. Is there another way
to prevent multiple forms from being open at the same time?
> If you're just having different components on each tab, why do you need
> MDI child forms at all? Just put the controls right on the tab page.
[quoted text clipped - 10 lines]
> > without using parent child relations, and if so how would I prevent the
> > user from having more than one of them open at a time?
Marc Vangrieken - 09 Aug 2006 21:13 GMT
> Well that is what I am already doing already. What I'm using the MDI
> child forms for is say there is a button on every tabpage that will
> result in a form being activated. i wanted to use MDI children so that
> only one of these forms could be shown at a time. Is there another way
> to prevent multiple forms from being open at the same time?
You could do the following in the code where you are creating an
instance of, lets say, Form2. Loop through the MdiChildren array, if
you find an instance of that type then do something with it, else
instantiate it.
foreach (Form frm in MdiChildren)
if (frm is Form2)
{
frm.BringToFront();
break;
}
I hope this help...
rhaazy - 10 Aug 2006 15:58 GMT
MDI children forms can not cover controls of the parent form.
Unfortunately I merely have to change my methodology, getting rid of
parent child relations all together and using showdialog to call forms
that I dont' want the user to create more than one instance of.
> > Well that is what I am already doing already. What I'm using the MDI
> > child forms for is say there is a button on every tabpage that will
[quoted text clipped - 15 lines]
>
> I hope this help...
Andy - 09 Aug 2006 21:49 GMT
Take Marcs advice; using mdi children doesn't stop as many of any
particular kind of form from being displayed at all.
> Well that is what I am already doing already. What I'm using the MDI
> child forms for is say there is a button on every tabpage that will
[quoted text clipped - 16 lines]
> > > without using parent child relations, and if so how would I prevent the
> > > user from having more than one of them open at a time?
Otis Mukinfus - 10 Aug 2006 02:53 GMT
>Well that is what I am already doing already. What I'm using the MDI
>child forms for is say there is a button on every tabpage that will
[quoted text clipped - 16 lines]
>> > without using parent child relations, and if so how would I prevent the
>> > user from having more than one of them open at a time?
Look up ShowDialog in the help files. If you only want the user to be able to
access one form at a time, opening a form with ShowDialog opens it as a modal
form. When a user opens a modal form they cannot access any other form until
they close it.
Good luck with your project,
Otis Mukinfus
http://www.arltex.com
http://www.tomchilders.com
rhaazy - 10 Aug 2006 15:56 GMT
Thank you Otis, your reply was most helpful and I will be using
ShowDialog.
> >Well that is what I am already doing already. What I'm using the MDI
> >child forms for is say there is a button on every tabpage that will
[quoted text clipped - 26 lines]
> http://www.arltex.com
> http://www.tomchilders.com