473,387 Members | 1,542 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,387 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 13536
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
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
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...

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.