473,559 Members | 2,982 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 4486
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
7751
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 though I have one set to style="display='none'". When I click on the Edit button on a row, I want to hide that row and in its PHYSICAL place show the...
9
883
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 of the individual tabs. The tab page has no "visible" property. The tabpage class has a "hide" method, but this does not seem to make it...
4
8719
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 (document.getElementById) { return document.getElementById(object);
4
1649
by: MLH | last post by:
Is there a simple way to hide built-in toolbars in A97?
2
3185
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
15650
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 section of about 6 table rows that all need to be hidden if a certain condition is met. But I don't want to hide the whole table. And, I don't want to...
6
394
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 functions I have 2 sub functions under each("Add Job", "View Jobs" and "Add User", "View Users"). I have theses subfunctions grouped in a...
4
4216
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 I would really like to use linked images instead to do the following: - When open.gif is clicked, the contents of the div show and open.gif is...
0
4739
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 then clicking on any of th screens or tray icon it should stop. I tried the following (To start it on pressing escape on form1 and end it when...
0
7629
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...
0
7550
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...
0
7836
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. ...
0
8061
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
6184
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...
1
5455
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...
0
3603
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...
1
1165
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
872
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.