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 | | | | re: Show/Hide multiple TabControls at runtime
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:
[color=blue]
> 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[/color] | | | | re: Show/Hide multiple TabControls at runtime
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:
[color=blue]
> 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[/color] | | | | re: Show/Hide multiple TabControls at runtime
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:
[color=blue]
> 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:
>[color=green]
> > 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[/color][/color] | | | | re: Show/Hide multiple TabControls at runtime
there is no hide() or show() method on the microsoft tab control
--
Jorge L. Matos
"Steve" wrote:
[color=blue]
> 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:
>[color=green]
> > 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:
> >[color=darkred]
> > > 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[/color][/color][/color] | | | | re: Show/Hide multiple TabControls at runtime
there is on mine. Visual Studio .Net 2003, I've used it.
"Jorge L Matos [MCSD.NET]" wrote:
[color=blue]
> there is no hide() or show() method on the microsoft tab control
> --
> Jorge L. Matos
>
>
>
> "Steve" wrote:
>[color=green]
> > 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:
> >[color=darkred]
> > > 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[/color][/color][/color] | | | | re: Show/Hide multiple TabControls at runtime
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:
[color=blue]
> there is on mine. Visual Studio .Net 2003, I've used it.
>
> "Jorge L Matos [MCSD.NET]" wrote:
>[color=green]
> > there is no hide() or show() method on the microsoft tab control
> > --
> > Jorge L. Matos
> >
> >
> >
> > "Steve" wrote:
> >[color=darkred]
> > > 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[/color][/color][/color] |  | Similar .NET Framework bytes | | | /bytes/about
We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights.
Get the best answers to your questions from over 226,471 network members.
|