473,324 Members | 2,356 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Show/Hide multiple TabControls at runtime

Visual Studio 2003 C# Windows:

I have a tree view control as my main menu control down the left side of my
application. This has 2 Parent Nodes on it (Jobs and Employees). beneath
these 2 main functions I have 2 sub functions under each("Add Job", "View
Jobs" and "Add User", "View Users"). I have theses subfunctions grouped in a
TabControl, so there are 2 TabControl objects on my main screen, each with 2
pages on.

When the user first enters the application, all they can see is the Menu
Tree View. When they click a child node in the treeview, it reveals to them
the TabControl for the parent node of the one they selected, and changes the
TabPage to the relevant child node sub function.

My question is this:

Should I just be using the TabControl.Hide() and TabControl.Show() methods
to achieve this functionality i.e When they select a "Add User" I call
tcUsers.Show() then tcJobs.Hide(), and vice versa if they picked "Add Job"
OR
Should I destroy the current TabControl object, and then rebuild the
requested TabControl object??

If so, how do I do this destroy and create process?

Thanks

Steve
Jul 21 '05 #1
5 4457
My suggestion to you is to use the "Visible" property to show or hide the tab
control. Setting Visible to "true" makes the tab control appear and setting
it to "false" makes the control disappear.

--
Jorge L. Matos

"Steve" wrote:
Visual Studio 2003 C# Windows:

I have a tree view control as my main menu control down the left side of my
application. This has 2 Parent Nodes on it (Jobs and Employees). beneath
these 2 main functions I have 2 sub functions under each("Add Job", "View
Jobs" and "Add User", "View Users"). I have theses subfunctions grouped in a
TabControl, so there are 2 TabControl objects on my main screen, each with 2
pages on.

When the user first enters the application, all they can see is the Menu
Tree View. When they click a child node in the treeview, it reveals to them
the TabControl for the parent node of the one they selected, and changes the
TabPage to the relevant child node sub function.

My question is this:

Should I just be using the TabControl.Hide() and TabControl.Show() methods
to achieve this functionality i.e When they select a "Add User" I call
tcUsers.Show() then tcJobs.Hide(), and vice versa if they picked "Add Job"
OR
Should I destroy the current TabControl object, and then rebuild the
requested TabControl object??

If so, how do I do this destroy and create process?

Thanks

Steve

Jul 21 '05 #2
what is the beneift of visible over hide() and show(). My main concern with
doing it in this kind of way though was from a memory usage point, when you
hide or make an object not visible, does it stay in memory? Is this a point
worth worrying about?

"Jorge L Matos [MCSD.NET]" wrote:
My suggestion to you is to use the "Visible" property to show or hide the tab
control. Setting Visible to "true" makes the tab control appear and setting
it to "false" makes the control disappear.

--
Jorge L. Matos

"Steve" wrote:
Visual Studio 2003 C# Windows:

I have a tree view control as my main menu control down the left side of my
application. This has 2 Parent Nodes on it (Jobs and Employees). beneath
these 2 main functions I have 2 sub functions under each("Add Job", "View
Jobs" and "Add User", "View Users"). I have theses subfunctions grouped in a
TabControl, so there are 2 TabControl objects on my main screen, each with 2
pages on.

When the user first enters the application, all they can see is the Menu
Tree View. When they click a child node in the treeview, it reveals to them
the TabControl for the parent node of the one they selected, and changes the
TabPage to the relevant child node sub function.

My question is this:

Should I just be using the TabControl.Hide() and TabControl.Show() methods
to achieve this functionality i.e When they select a "Add User" I call
tcUsers.Show() then tcJobs.Hide(), and vice versa if they picked "Add Job"
OR
Should I destroy the current TabControl object, and then rebuild the
requested TabControl object??

If so, how do I do this destroy and create process?

Thanks

Steve

Jul 21 '05 #3
there is no hide() or show() method on the microsoft tab control
--
Jorge L. Matos

"Steve" wrote:
what is the beneift of visible over hide() and show(). My main concern with
doing it in this kind of way though was from a memory usage point, when you
hide or make an object not visible, does it stay in memory? Is this a point
worth worrying about?

"Jorge L Matos [MCSD.NET]" wrote:
My suggestion to you is to use the "Visible" property to show or hide the tab
control. Setting Visible to "true" makes the tab control appear and setting
it to "false" makes the control disappear.

--
Jorge L. Matos

"Steve" wrote:
Visual Studio 2003 C# Windows:

I have a tree view control as my main menu control down the left side of my
application. This has 2 Parent Nodes on it (Jobs and Employees). beneath
these 2 main functions I have 2 sub functions under each("Add Job", "View
Jobs" and "Add User", "View Users"). I have theses subfunctions grouped in a
TabControl, so there are 2 TabControl objects on my main screen, each with 2
pages on.

When the user first enters the application, all they can see is the Menu
Tree View. When they click a child node in the treeview, it reveals to them
the TabControl for the parent node of the one they selected, and changes the
TabPage to the relevant child node sub function.

My question is this:

Should I just be using the TabControl.Hide() and TabControl.Show() methods
to achieve this functionality i.e When they select a "Add User" I call
tcUsers.Show() then tcJobs.Hide(), and vice versa if they picked "Add Job"
OR
Should I destroy the current TabControl object, and then rebuild the
requested TabControl object??

If so, how do I do this destroy and create process?

Thanks

Steve

Jul 21 '05 #4
there is on mine. Visual Studio .Net 2003, I've used it.

"Jorge L Matos [MCSD.NET]" wrote:
there is no hide() or show() method on the microsoft tab control
--
Jorge L. Matos

"Steve" wrote:
what is the beneift of visible over hide() and show(). My main concern with
doing it in this kind of way though was from a memory usage point, when you
hide or make an object not visible, does it stay in memory? Is this a point
worth worrying about?

"Jorge L Matos [MCSD.NET]" wrote:
My suggestion to you is to use the "Visible" property to show or hide the tab
control. Setting Visible to "true" makes the tab control appear and setting
it to "false" makes the control disappear.

--
Jorge L. Matos

"Steve" wrote:

> Visual Studio 2003 C# Windows:
>
> I have a tree view control as my main menu control down the left side of my
> application. This has 2 Parent Nodes on it (Jobs and Employees). beneath
> these 2 main functions I have 2 sub functions under each("Add Job", "View
> Jobs" and "Add User", "View Users"). I have theses subfunctions grouped in a
> TabControl, so there are 2 TabControl objects on my main screen, each with 2
> pages on.
>
> When the user first enters the application, all they can see is the Menu
> Tree View. When they click a child node in the treeview, it reveals to them
> the TabControl for the parent node of the one they selected, and changes the
> TabPage to the relevant child node sub function.
>
> My question is this:
>
> Should I just be using the TabControl.Hide() and TabControl.Show() methods
> to achieve this functionality i.e When they select a "Add User" I call
> tcUsers.Show() then tcJobs.Hide(), and vice versa if they picked "Add Job"
> OR
> Should I destroy the current TabControl object, and then rebuild the
> requested TabControl object??
>
> If so, how do I do this destroy and create process?
>
> Thanks
>
> Steve

Jul 21 '05 #5
You're right, the Show() and Hide() methods are inherited from the Control
base class. I never use those methods since they are equivalent to setting
the Visible property to true or false respectively and I've always used the
Visible property. To answer your question the control remains in memory when
you use the Hide() or Show() methods ( or set the Visibile property to true
or false ). I do not recommend destroying and re-creating objects when you
do not need to do so.

--
Jorge L. Matos

"Steve" wrote:
there is on mine. Visual Studio .Net 2003, I've used it.

"Jorge L Matos [MCSD.NET]" wrote:
there is no hide() or show() method on the microsoft tab control
--
Jorge L. Matos

"Steve" wrote:
what is the beneift of visible over hide() and show(). My main concern with
doing it in this kind of way though was from a memory usage point, when you
hide or make an object not visible, does it stay in memory? Is this a point
worth worrying about?

"Jorge L Matos [MCSD.NET]" wrote:

> My suggestion to you is to use the "Visible" property to show or hide the tab
> control. Setting Visible to "true" makes the tab control appear and setting
> it to "false" makes the control disappear.
>
> --
> Jorge L. Matos
>
>
>
> "Steve" wrote:
>
> > Visual Studio 2003 C# Windows:
> >
> > I have a tree view control as my main menu control down the left side of my
> > application. This has 2 Parent Nodes on it (Jobs and Employees). beneath
> > these 2 main functions I have 2 sub functions under each("Add Job", "View
> > Jobs" and "Add User", "View Users"). I have theses subfunctions grouped in a
> > TabControl, so there are 2 TabControl objects on my main screen, each with 2
> > pages on.
> >
> > When the user first enters the application, all they can see is the Menu
> > Tree View. When they click a child node in the treeview, it reveals to them
> > the TabControl for the parent node of the one they selected, and changes the
> > TabPage to the relevant child node sub function.
> >
> > My question is this:
> >
> > Should I just be using the TabControl.Hide() and TabControl.Show() methods
> > to achieve this functionality i.e When they select a "Add User" I call
> > tcUsers.Show() then tcJobs.Hide(), and vice versa if they picked "Add Job"
> > OR
> > Should I destroy the current TabControl object, and then rebuild the
> > requested TabControl object??
> >
> > If so, how do I do this destroy and create process?
> >
> > Thanks
> >
> > Steve

Jul 21 '05 #6

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

Similar topics

3
by: KathyB | last post by:
Hi, totally new to the div show/hide thing. I have some rows in a table. When I first load the page, I only want to see divs where the divID=ForView. When I load now, I see BOTH rows...even...
9
by: Robb Gilmore | last post by:
Hello, This is probably an easy one, but I have not been able to figure it out so far. I have a tab control on a windows forms app. Depending on some business logic, I need to hide/show some...
4
by: itunes66 | last post by:
how can i do this i already have a function to show/hide elements with one link but how can i show/hide multiple elements here is the script function obj_ref(object) { if...
4
by: MLH | last post by:
Is there a simple way to hide built-in toolbars in A97?
2
by: MAF | last post by:
How do I hide a tabpage of a given tab control? //Disable other tabs until item is saved this.tabPage2.Hide(); //this doesn't work this.tabPage3.Hide(); this.tabPage4.Hide();
12
by: Jerad Rose | last post by:
I searched for a while trying to find the answer to this, but to no avail. I am trying to find the best way (or any way) to dynamically show and hide groups of TR's. For example, I have a...
6
by: Steve | last post by:
Visual Studio 2003 C# Windows: I have a tree view control as my main menu control down the left side of my application. This has 2 Parent Nodes on it (Jobs and Employees). beneath these 2 main...
4
by: bridgemanusa | last post by:
Hi All: I have a very long page of html that I want to take portions and hide them in divs, then show when a link is clicked. I have the hide show part working when the link is clicked, however...
0
by: question | last post by:
Hi! I have a requirement where I need to display multiple forms one after the other like a slide show. These are in the same application. Basicall on selection of a menu item it should start...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.