473,763 Members | 6,666 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Best way to have a tabbed MDI application

Hi all,

As some of you would know from my previous posts that I am rewriting our Unix
based system into .Net with a MDI interface.

Recently I have added a tab control to the top of the MDI parent form that
will contain a tab page for each open MDI child form. It is only 24 pixels
high so all you see is the tabstrip. Then I only have to add a bit of code to
the "changed index" event of the tab control as well as the "on activate"
event for the child forms (which is actually done on a baseform which is
inherited by all the child forms) to ensure that if either a tab is clicked
or another child form is activated then the current child form and current
tab are in sync.

Nothing too complicated here, but I am currently tossing up whether to
actually do away with having MDI child forms and just create all the intended
child forms as user controls which when required are inserted onto a new tab
page. But I am unsure if this is going to create headaches for me in managing
tab pages rather than MDI child forms.

The problem I have with an MDI app is preventing the users from changing the
state of the child form - I would like to have it maximised all the time. Is
there way to prevent the control box in the upper right corner of the MDI
form from being displayed?

Anyway, it would be great if people could share their experiences on tabbed
MDI applications so I can be aware of any pitfalls before I make the decision.
tia,

Mac

--
Message posted via DotNetMonster.c om
http://www.dotnetmonster.com/Uwe/For...b-net/200512/1
Dec 8 '05 #1
14 4861
Mac,

I did this and I thought it worked out pretty well. Use the tab control,
then instantiate each form setting its parent to the tab page. You take the
boder off, set the dock to fill and there you go.

something like this...
dim fObjSelector as frmObjectSelect or
fObjSelector = New frmObjectSelect or
fObjSelector.Fo rmBorderStyle = FormBorderStyle .None
fObjSelector.To pLevel = False
fObjSelector.Pa rent = Me.FromHandle(T abControl1.TabP ages(0).Handle)
fObjSelector.Do ck = DockStyle.Fill
fObjSelector.Sh ow()

jeff

"Mac via DotNetMonster.c om" <u9483@uwe> wrote in message
news:58803686cb c54@uwe...
Hi all,

As some of you would know from my previous posts that I am rewriting our
Unix
based system into .Net with a MDI interface.

Recently I have added a tab control to the top of the MDI parent form that
will contain a tab page for each open MDI child form. It is only 24 pixels
high so all you see is the tabstrip. Then I only have to add a bit of code
to
the "changed index" event of the tab control as well as the "on activate"
event for the child forms (which is actually done on a baseform which is
inherited by all the child forms) to ensure that if either a tab is
clicked
or another child form is activated then the current child form and current
tab are in sync.

Nothing too complicated here, but I am currently tossing up whether to
actually do away with having MDI child forms and just create all the
intended
child forms as user controls which when required are inserted onto a new
tab
page. But I am unsure if this is going to create headaches for me in
managing
tab pages rather than MDI child forms.

The problem I have with an MDI app is preventing the users from changing
the
state of the child form - I would like to have it maximised all the time.
Is
there way to prevent the control box in the upper right corner of the MDI
form from being displayed?

Anyway, it would be great if people could share their experiences on
tabbed
MDI applications so I can be aware of any pitfalls before I make the
decision.
tia,

Mac

--
Message posted via DotNetMonster.c om
http://www.dotnetmonster.com/Uwe/For...b-net/200512/1

Dec 8 '05 #2
Mac,

Go first sit on the chair of your user.

Imaging that are using word and instead of that it is a MDI application as
it is, you have extended it with a Tab control where in can be all your
documents that are open.

I become already confused if I have 4 mdi doc files open in Word direct on
my screen. While you want to hide them even in tabpages.

I hope that this gives you an idea.
To give an exact answer, it is in my opinion a MDI or a Tab page, not both.

For me is a technical nice solution is not always a good user solution.

Just my thought,

Cor
"Mac via DotNetMonster.c om" <u9483@uwe> schreef in bericht
news:58803686cb c54@uwe...
Hi all,

As some of you would know from my previous posts that I am rewriting our
Unix
based system into .Net with a MDI interface.

Recently I have added a tab control to the top of the MDI parent form that
will contain a tab page for each open MDI child form. It is only 24 pixels
high so all you see is the tabstrip. Then I only have to add a bit of code
to
the "changed index" event of the tab control as well as the "on activate"
event for the child forms (which is actually done on a baseform which is
inherited by all the child forms) to ensure that if either a tab is
clicked
or another child form is activated then the current child form and current
tab are in sync.

Nothing too complicated here, but I am currently tossing up whether to
actually do away with having MDI child forms and just create all the
intended
child forms as user controls which when required are inserted onto a new
tab
page. But I am unsure if this is going to create headaches for me in
managing
tab pages rather than MDI child forms.

The problem I have with an MDI app is preventing the users from changing
the
state of the child form - I would like to have it maximised all the time.
Is
there way to prevent the control box in the upper right corner of the MDI
form from being displayed?

Anyway, it would be great if people could share their experiences on
tabbed
MDI applications so I can be aware of any pitfalls before I make the
decision.
tia,

Mac

--
Message posted via DotNetMonster.c om
http://www.dotnetmonster.com/Uwe/For...b-net/200512/1

Dec 8 '05 #3
Hi Jeff,

I am having difficulty trying to reproduce your solution. If I understand
correctly, it appears as though you have a form which you are slotting in as
a tabpage, which means you don't actually set the MDIParent property of these
forms at all? Is this correct?

And your frmObjectSelect or is of type form? Also where exactly is this code
placed - in your container form? Even though I know they exist, I cannot
access the Me.Fromhandle property or the TopLevel property.

Can you give me some further info on how you got this solution going - I
really like the sound of it. It if it behaves like it I think it will, it
will overcome the issue I had (and Cor pointed out) of having a detached
tabcontrol and MDI forms.
regards,

Mac

Jeff Jarrell wrote:
Mac,

I did this and I thought it worked out pretty well. Use the tab control,
then instantiate each form setting its parent to the tab page. You take the
boder off, set the dock to fill and there you go.

something like this...
dim fObjSelector as frmObjectSelect or
fObjSelector = New frmObjectSelect or
fObjSelector.Fo rmBorderStyle = FormBorderStyle .None
fObjSelector.To pLevel = False
fObjSelector.Pa rent = Me.FromHandle(T abControl1.TabP ages(0).Handle)
fObjSelector.Do ck = DockStyle.Fill
fObjSelector.Sh ow()

jeff
Hi all,

[quoted text clipped - 37 lines]

Mac


--
Message posted via DotNetMonster.c om
http://www.dotnetmonster.com/Uwe/For...b-net/200512/1
Dec 8 '05 #4
Thanks for that Cor - I think I got your point (actually I kinda feel like
Neo after a visit to the Oracle - I need a cookie!! :)

My concerns with having a tabfolder with all the forms as tab pages rather
than an MDI was that I would lose all the functionality that goes with forms?
Is this something I shouldn't be concerned about? Also being able to merge
the menu of the child form into that of the MDI parent is something that is
going to be handy for us. Is there a way to get around this?

I suppose what I would like is the best of both worlds, but in the end I may
just have to choose. But this a decision I am kinds dreading having to make
as it will determine the whole make up of the application!!

How have you seen the tab setup work because I really think this is way I
want to go. Just having MDI forms I think is a bit "old" and the users cannot
see what all the screens are that they have opened. I suppose also with the
tab setup I am trying to reproduce something similar to how Lotus Note is
setup.

Any thoughts appreciated

Mac

Cor Ligthert [MVP] wrote:
Mac,

Go first sit on the chair of your user.

Imaging that are using word and instead of that it is a MDI application as
it is, you have extended it with a Tab control where in can be all your
documents that are open.

I become already confused if I have 4 mdi doc files open in Word direct on
my screen. While you want to hide them even in tabpages.

I hope that this gives you an idea.
To give an exact answer, it is in my opinion a MDI or a Tab page, not both.

For me is a technical nice solution is not always a good user solution.

Just my thought,

Cor
Hi all,

[quoted text clipped - 37 lines]

Mac


--
Message posted via DotNetMonster.c om
http://www.dotnetmonster.com/Uwe/For...b-net/200512/1
Dec 8 '05 #5
Mac,

You have a MainForm that has a tab control. You have more forms in the
project that you will instantiate and insert into each tab page (where the
tab page the owner of the form. Most likely you'd put the sample code into
the form load of the MainForm. Nothing is marked as special like MDI
parent.

The seven lines of code would occur for each form you insert (or you would
generalize this.

frmObjectSelect or is a form with controls and stuff on it. nothing special.

I have used this techique to on complex forms to split out complexity into a
number of smaller forms (so multiple developers can work on it) rather than
a single, big, complex, monolithic form.

If you are still having problems let me know and i will get extract a
working sample for you.

jeff

"Mac via DotNetMonster.c om" <u9483@uwe> wrote in message
news:588c6f2cb9 9f7@uwe...
Hi Jeff,

I am having difficulty trying to reproduce your solution. If I understand
correctly, it appears as though you have a form which you are slotting in
as
a tabpage, which means you don't actually set the MDIParent property of
these
forms at all? Is this correct?

And your frmObjectSelect or is of type form? Also where exactly is this
code
placed - in your container form? Even though I know they exist, I cannot
access the Me.Fromhandle property or the TopLevel property.

Can you give me some further info on how you got this solution going - I
really like the sound of it. It if it behaves like it I think it will, it
will overcome the issue I had (and Cor pointed out) of having a detached
tabcontrol and MDI forms.
regards,

Mac

Jeff Jarrell wrote:
Mac,

I did this and I thought it worked out pretty well. Use the tab control,
then instantiate each form setting its parent to the tab page. You take
the
boder off, set the dock to fill and there you go.

something like this...
dim fObjSelector as frmObjectSelect or
fObjSelector = New frmObjectSelect or
fObjSelector.Fo rmBorderStyle = FormBorderStyle .None
fObjSelector.To pLevel = False
fObjSelector.Pa rent =
Me.FromHandle(T abControl1.TabP ages(0).Handle)
fObjSelector.Do ck = DockStyle.Fill
fObjSelector.Sh ow()

jeff
Hi all,

[quoted text clipped - 37 lines]

Mac


--
Message posted via DotNetMonster.c om
http://www.dotnetmonster.com/Uwe/For...b-net/200512/1

Dec 9 '05 #6
Hi again Jeff,

Have managed to get further - I can access those properties, they just
weren't in the intellisense box. Don't quite understand that but I am not
going to worry about.

Will continue to play with it - getting an invalid index message at the
moment. Will let you know how I go.
Mac

Mac wrote:
Thanks for that Cor - I think I got your point (actually I kinda feel like
Neo after a visit to the Oracle - I need a cookie!! :)

My concerns with having a tabfolder with all the forms as tab pages rather
than an MDI was that I would lose all the functionality that goes with forms?
Is this something I shouldn't be concerned about? Also being able to merge
the menu of the child form into that of the MDI parent is something that is
going to be handy for us. Is there a way to get around this?

I suppose what I would like is the best of both worlds, but in the end I may
just have to choose. But this a decision I am kinds dreading having to make
as it will determine the whole make up of the application!!

How have you seen the tab setup work because I really think this is way I
want to go. Just having MDI forms I think is a bit "old" and the users cannot
see what all the screens are that they have opened. I suppose also with the
tab setup I am trying to reproduce something similar to how Lotus Note is
setup.

Any thoughts appreciated

Mac
Mac,

[quoted text clipped - 21 lines]

Mac


--
Message posted via DotNetMonster.c om
http://www.dotnetmonster.com/Uwe/For...b-net/200512/1
Dec 9 '05 #7
Jeff,

couldn't seem to get past the index error - "0 is not a valid value for
index". In an attempt to resolve it before the Me.FromHandle statement I
actually added a blank tabpage to the tab control.

The Me.FromHandle statement was then fine, but I then got an "object not
instantiated" error when I attempt myForm.show. I then tried a more basic
form and there was no error but the form doesn't actually show! So in the end
my workaround doesn't work, so I guess I am back to trying to fix the index
error. Do you have any suggestions? Do I need to do something to the
tabcontrol first before referencing it?
Mac

Mac wrote:
Hi again Jeff,

Have managed to get further - I can access those properties, they just
weren't in the intellisense box. Don't quite understand that but I am not
going to worry about.

Will continue to play with it - getting an invalid index message at the
moment. Will let you know how I go.

Mac
Thanks for that Cor - I think I got your point (actually I kinda feel like
Neo after a visit to the Oracle - I need a cookie!! :)

[quoted text clipped - 24 lines]

Mac


--
Message posted via DotNetMonster.c om
http://www.dotnetmonster.com/Uwe/For...b-net/200512/1
Dec 9 '05 #8
you do need to have (read insert) a blank tab page for each sub form you are
instantiating.

"Mac via DotNetMonster.c om" <u9483@uwe> wrote in message
news:588e33d3a9 ba7@uwe...
Jeff,

couldn't seem to get past the index error - "0 is not a valid value for
index". In an attempt to resolve it before the Me.FromHandle statement I
actually added a blank tabpage to the tab control.

The Me.FromHandle statement was then fine, but I then got an "object not
instantiated" error when I attempt myForm.show. I then tried a more basic
form and there was no error but the form doesn't actually show! So in the
end
my workaround doesn't work, so I guess I am back to trying to fix the
index
error. Do you have any suggestions? Do I need to do something to the
tabcontrol first before referencing it?
Mac

Mac wrote:
Hi again Jeff,

Have managed to get further - I can access those properties, they just
weren't in the intellisense box. Don't quite understand that but I am not
going to worry about.

Will continue to play with it - getting an invalid index message at the
moment. Will let you know how I go.

Mac
Thanks for that Cor - I think I got your point (actually I kinda feel
like
Neo after a visit to the Oracle - I need a cookie!! :)

[quoted text clipped - 24 lines]
>
> Mac


--
Message posted via DotNetMonster.c om
http://www.dotnetmonster.com/Uwe/For...b-net/200512/1

Dec 11 '05 #9
Out of interest, I have done the same as Jeff in his answer, but instead of
using the tab control, I've used a toolbar and a panel.

What I do is respond to the click event of the toolbar, work out which
button has been selected and change it to "pressed" so the user can see
which is the active button and then set the mdiparent of the form in
question to the panel (after creating the form if necessary)... (you need to
switch the "toplevel" property of the form to false You can turn off the
control box and title for the form to make it appear "properly" (rather than
looking like a form on a panel!).

I'm presuming that you are not using mdi forms in the same way as word - ie
open multiple documents, but more as a way of breaking the functionality of
an application up ?

Just another way forward. I prefer it to the tabcontrol because you can
assign images easily to the buttons and have more control of the visuals...

You do still have the "menus" problems, but you could pretty easily merge
the menus if required in code..

Regards
Simon

"Mac via DotNetMonster.c om" <u9483@uwe> wrote in message
news:58803686cb c54@uwe...
Hi all,

As some of you would know from my previous posts that I am rewriting our
Unix
based system into .Net with a MDI interface.

Recently I have added a tab control to the top of the MDI parent form that
will contain a tab page for each open MDI child form. It is only 24 pixels
high so all you see is the tabstrip. Then I only have to add a bit of code
to
the "changed index" event of the tab control as well as the "on activate"
event for the child forms (which is actually done on a baseform which is
inherited by all the child forms) to ensure that if either a tab is
clicked
or another child form is activated then the current child form and current
tab are in sync.

Nothing too complicated here, but I am currently tossing up whether to
actually do away with having MDI child forms and just create all the
intended
child forms as user controls which when required are inserted onto a new
tab
page. But I am unsure if this is going to create headaches for me in
managing
tab pages rather than MDI child forms.

The problem I have with an MDI app is preventing the users from changing
the
state of the child form - I would like to have it maximised all the time.
Is
there way to prevent the control box in the upper right corner of the MDI
form from being displayed?

Anyway, it would be great if people could share their experiences on
tabbed
MDI applications so I can be aware of any pitfalls before I make the
decision.
tia,

Mac

--
Message posted via DotNetMonster.c om
http://www.dotnetmonster.com/Uwe/For...b-net/200512/1

Dec 11 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
3268
by: Frances | last post by:
Hi All, * PREMISE * I'm creating an Access form with 150 items subdivided into 20 categories. Multiple categories (and items) can be selected so my user wants checkboxes. All of the options need to be visible at the same time so no dropdowns (combo boxes) and no scrolling lists (list boxes). I will use tabbed sheets with logically grouped categories (and their respective items).
1
1530
by: Jim Hubbard | last post by:
I'd love to see a VB.Net 2.0 example of a tabbed interface. It could be a notepad-type or browser-type application....doesn't matter. What would be great is an example that incorporated a custom control or interface on each tab and not just a simple single control per tab. Thanks for your help.
4
7425
by: Martin | last post by:
Hi all! As a preparation of a conversion from VB6 to VB2005 I'm playing around with VB2005. One of the first things that strike me is the user-interface. In all documentation Microsoft keeps going on about this beautiful Tabbed MDI Interface that we all should be using. And I agree, it is nice. So I set out to build my first test-app and guess what? I can't find how to create a Tabbed MDI Interface... I do see the "old" MDI container,...
3
2774
by: kev | last post by:
Hello, I posted a question a while ago on tabbed pages, how to set it to invisible when the text box is empty.It was answered by Rick and the code ran perfectly. However, i tried using the same code for another scenario and it gives me compile error:method or data member not found. My scenario is i have a nested tab page.My main tabbed page has 4 tabs, About, SafetyLevel1,SafetyLevel2,SafetyLevel3. Inside this main, i created a...
0
7516
NeoPa
by: NeoPa | last post by:
Originally posted by Missinglinq: The first thing to remember is that Tabbed Pages are all part of a single form; think of it as a really long form turned on its side and folded on itself. Because it is all one form, references to contols on any page are done in the same manner as if they were all on one single screen. Create a form in Design View. Goto the toolbox and click on the Tabbed Control icon; it actually looks like several...
8
3081
daJunkCollector
by: daJunkCollector | last post by:
Hey, I am developing a website. A 2-tier tabbed navigation system is the desgin we are going with. Just for clarification purposes, I will developing the site in ASP.NET. What do you think the best way to make the 2-tier tabbed navigation system will be? I currently have a prototype developed using CSS/HTML and a touch of javascript. The problem is that this presents horrible formatting issues when working across different web...
11
2621
by: AndyM | last post by:
Hi, I have a curious problem that is causing me large amounts of grief and is steadily turning me grey. Hopefully you guys can help. I have a Master table that contains a CustomerID (as well as customer name etc), this is used as the Primary key to all the tables relating to that customer. I've been using 1 to Many relationships for most of the tables (e.g A customer can have many addresses) with Referential Integrity and cascading turned...
7
2829
by: meekstro | last post by:
I have been assigned to design an application that uses tabbed panes for different catagories and collects information bout size and quantity. Also it is suppose to display the cost of the order as information is gathered. How should I go about displaying the cost? I have the tabbed panes set up. I was thinking I need to utilize some sort of actionlistener but am not sure how to implement this. Thanks for the help. I have included some...
19
7266
by: hedges98 | last post by:
Sorry for the mouthful of a title! Basically, I have a form with tabbed controls (Personal/Contact Details, Referral Information, Case Info/Status etc.) and I want to add a tabbed control form inside one of the existing tabs. At the moment there are two tabs called Appointments and Group Appointments. What I want to do is add a tabbed control inside the Appointments tab with two tabs called Individual Appointments and Group Appointments...
0
9564
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9387
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10148
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8822
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7368
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6643
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5270
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5406
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3528
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.