473,847 Members | 1,743 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 4514
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
7777
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 ForEdit div for that item...leaving all other divs as is. I've seen some examples, everyone seems...
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 disappear. I have been able to remove them via something like this:
4
8750
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
1666
by: MLH | last post by:
Is there a simple way to hide built-in toolbars in A97?
2
3203
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
15684
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 split up the table because the columns need to remain intact. I thought about using runat=server...
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 TabControl, so there are 2 TabControl objects on my main screen, each with 2 pages on. When the user...
4
4234
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 swapped with close.gif - subsequently, when close.gif is clicked, the div contents get hidden
0
4757
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 escape is again
0
10983
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
10648
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10707
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9485
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
7883
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
7056
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
5719
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
5911
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4529
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.