Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / August 2006

Tip: Looking for answers? Try searching our database.

Question about MDI application

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
rhaazy - 09 Aug 2006 15:23 GMT
I have an MDI application with the MDI parent container has a
tabcontrol on it.  When I bring up any child MDI forms, it won't show
up over the tabcontrol.  I have tried the form.bringtofront() and that
doesnt work.  Short setting the controls visible property to false, I
can not figure this one out.  Anyone have any ideas????
Andy - 09 Aug 2006 15:26 GMT
MDI parent forms shouldn't have any controls like that placed on them;
at most, they should have menus and toolbar controls.

What are you trying to acomplish by having a tab control on the MDI
parent?

Andy

> I have an MDI application with the MDI parent container has a
> tabcontrol on it.  When I bring up any child MDI forms, it won't show
> up over the tabcontrol.  I have tried the form.bringtofront() and that
> doesnt work.  Short setting the controls visible property to false, I
> can not figure this one out.  Anyone have any ideas????
rhaazy - 09 Aug 2006 19:00 GMT
Well, my application is basically one form with a tabcontrol on it.
Each tabpage is a different "screen" if you will.  The MDI children are
all for the purpose of adding or editing underlying data for the
database.  Does it not make sense to do this???   Should I just call
the forms normally????

> MDI parent forms shouldn't have any controls like that placed on them;
> at most, they should have menus and toolbar controls.
[quoted text clipped - 9 lines]
> > doesnt work.  Short setting the controls visible property to false, I
> > can not figure this one out.  Anyone have any ideas????
Andy - 09 Aug 2006 20:14 GMT
So you want the 'screens' to appear in the tabs?  Can the tabs be
opened / closed independantly?

If you want a MDI form like VS2005, there are 3rd party controls which
can do this easily.

If the tabs are fixed, you should create a user control instead of a
mdi child form; you can then add the control to each tab page.

Andy

> Well, my application is basically one form with a tabcontrol on it.
> Each tabpage is a different "screen" if you will.  The MDI children are
[quoted text clipped - 15 lines]
> > > doesnt work.  Short setting the controls visible property to false, I
> > > can not figure this one out.  Anyone have any ideas????
rhaazy - 09 Aug 2006 20:29 GMT
All I meant by screen was that each tabpage has a different set of
components on it.  In retrospect, each tabpage COULD BE its own form.
But instead I decided to make it simple and use a tabcontrol.  My MDI
child forms could pop up at about any time the user desires.  I wanted
to use the MDI format to prevent the user from having more than one of
these forms open at a time.  The Child forms are used for making
changes to the database.  Is it a better idea to just use a form
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?

> So you want the 'screens' to appear in the tabs?  Can the tabs be
> opened / closed independantly?
[quoted text clipped - 26 lines]
> > > > doesnt work.  Short setting the controls visible property to false, I
> > > > can not figure this one out.  Anyone have any ideas????
Andy - 09 Aug 2006 20:58 GMT
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.

Andy

> All I meant by screen was that each tabpage has a different set of
> components on it.  In retrospect, each tabpage COULD BE its own form.
[quoted text clipped - 5 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?
rhaazy - 09 Aug 2006 21:09 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?

> 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

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.