472,803 Members | 1,054 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Hide Method for TabPage object

I've researched as much as I can on the issue, but I've not found any clearly
defined statement that acknowledges that the Hide method for a TabPage object
just doesn't do what it's supposed to do. This appears to be a bug, or maybe
I'm using it incorrectly?

TabPage.Hide should hide the referenced TabPage object, should it not? Do I
have to 'refresh' the Windows form somehow?

The closest I've come to any means of hiding a TabPage from the TabControl
is to have a secondary TabControl that is hidden, and change the TabPage
object's Parent property to be the hidden TabControl. Then to make it
'reappear' in the original TabControl by reassigning the Parent property. The
only problem being here is that when the TabPage is reassigned to the
original, I have to write code to ensure that it 'reappears' in its
appropriate Index location. This just seems too silly to do, for a method
that is supposed to do this in the first place!
Jul 21 '05 #1
4 13490
Hide should have been removed from the options.
When a TabPage is not selected it is hidden (not visible).
What you want to do is remove and replace the TabPage. You don't need a
second TabControl to store it as the TabPage is not disposed when you remove
it from the TabControls TabPage Collection.

You will find Hide/Show/Insert/Swap TabPage methods on my site, along with a
few other tips.
http://dotnetrix.co.uk/tabcontrols.html

--
Mick Doherty
http://dotnetrix.co.uk/nothing.html
"TMB333" <TM****@discussions.microsoft.com> wrote in message
news:32**********************************@microsof t.com...
I've researched as much as I can on the issue, but I've not found any
clearly
defined statement that acknowledges that the Hide method for a TabPage
object
just doesn't do what it's supposed to do. This appears to be a bug, or
maybe
I'm using it incorrectly?

TabPage.Hide should hide the referenced TabPage object, should it not? Do
I
have to 'refresh' the Windows form somehow?

The closest I've come to any means of hiding a TabPage from the TabControl
is to have a secondary TabControl that is hidden, and change the TabPage
object's Parent property to be the hidden TabControl. Then to make it
'reappear' in the original TabControl by reassigning the Parent property.
The
only problem being here is that when the TabPage is reassigned to the
original, I have to write code to ensure that it 'reappears' in its
appropriate Index location. This just seems too silly to do, for a method
that is supposed to do this in the first place!

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.775 / Virus Database: 522 - Release Date: 08/10/2004
Jul 21 '05 #2
Hi Mike,

Thanks for the reply. Nice site by the way!

However, under the section "Hide and Show Tabpages in a Tabcontrol" from the
link you gave me, I can understand how to use the HideTabPage routine since I
can reference the TabPage on my TabControl by its Index to use as an argument
for the routine, however, I am unsure what to pass as an argument to the
ShowTabPage routine as my TabControl no longer has the 'hidden' TabPage to
reference by either its Index number or its Name?

I'm sorry if this might seem trivial to you, but as I've been programming in
VB6 for quite some time, I'm relatively new to VB.NET.

Thanks.
Jul 21 '05 #3
Ahh, I found the answer to my own question. I was unaware until now that I
can reference a TabPage object from the Form object itself.
Jul 21 '05 #4
You Instantiate the TabPage on the Form and then add it to the TabControls
TabPageCollection.

\\\
Sub InitializeComponent()
...
Me.TabPage1 = New System.Windows.Forms.TabPage
...
Me.TabControl1.TabPages.Add(Me.TabPage1)
...
End Sub
///

So the TabPage is actually a Child of the Form.

--
Mick Doherty
http://dotnetrix.co.uk/nothing.html
"TMB333" <TM****@discussions.microsoft.com> wrote in message
news:B2**********************************@microsof t.com...
Ahh, I found the answer to my own question. I was unaware until now that I
can reference a TabPage object from the Form object itself.

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.775 / Virus Database: 522 - Release Date: 08/10/2004
Jul 21 '05 #5

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

Similar topics

0
by: Thanos | last post by:
Hi everybody. Excuse my english is not perfect. I would to hide TabPages but I have tried >> TabPage.hide() or >> TabPage.Visible = False but no luck. Maybe the current Tab control...
5
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...
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...
3
by: Peter | last post by:
How do I hide and unhide Tabs in the TabControl at the runtime? Peter -- Thanks ------------------- czupet@wsinc.com
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();
8
by: Kejpa | last post by:
Hey there! I have a tabcontrol on one of my forms. Some of the tab should not be accessable (and thus invisible) until you give the correct password. But I can't hide the tab......
4
by: TMB333 | last post by:
I've researched as much as I can on the issue, but I've not found any clearly defined statement that acknowledges that the Hide method for a TabPage object just doesn't do what it's supposed to do....
0
by: xyz | last post by:
Hi, I have two tab control on two different pages. On one tabControl I need the tab headers. When I remove the tabpage from this tabControl and put it on another one I don't want to show the...
5
by: Amit | last post by:
Can anyone write the code to hide tabpage of tab control in windows form 2.0 Thanks, Amit
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
linyimin
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Sept 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

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.