473,804 Members | 3,809 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

tabcontrol - cannot disable or hide tab pages

Hi,
I'm upgrading an application from VB6 to .NET. It used tab controls in VB6
to achieve a tab dialogue / wizard type effect - navigating from one tab to
the next as the user filled in information.

When this has upgraded to .NET the user can suddenly click on the other tabs
without having completed the previous tabs i.e. the other tabs are not
disabled - only the controls on them are.

How do I disable and/or hide a tab page so that the user cannot navigate to
them by clicking on the tab ?

Regards
Michael
Nov 1 '05 #1
3 23050
You can't hide a tab anymore. You have to remove it from the tabpages
collection and readd it later. Real PITA.

http://www.ftponline.com/vsm/2004_09...a/default.aspx

May I suggest a much better way...

http://www.actiprosoftware.com/Produ...d/Default.aspx

Greg
What you have to do is
"ASGMikeG" <AS******@discu ssions.microsof t.com> wrote in message
news:4E******** *************** ***********@mic rosoft.com...
Hi,
I'm upgrading an application from VB6 to .NET. It used tab controls in
VB6
to achieve a tab dialogue / wizard type effect - navigating from one tab
to
the next as the user filled in information.

When this has upgraded to .NET the user can suddenly click on the other
tabs
without having completed the previous tabs i.e. the other tabs are not
disabled - only the controls on them are.

How do I disable and/or hide a tab page so that the user cannot navigate
to
them by clicking on the tab ?

Regards
Michael

Nov 1 '05 #2
TabControlEX allows you to disable tabs:
http://www.dotnetrix.co.uk/controls.html

....but it sounds like you should be using a Wizard Control:
http://www.codeproject.com/cs/miscctrl/SampleWizard.asp

or maybe a Tabless TabControl plus Next and Previous Buttons:
http://www.dotnetrix.co.uk/custom.html --> Create a PanelManager
(this class has designtime problems in VS2005).

--
Mick Doherty
http://dotnetrix.co.uk/nothing.html
"ASGMikeG" <AS******@discu ssions.microsof t.com> wrote in message
news:4E******** *************** ***********@mic rosoft.com...
Hi,
I'm upgrading an application from VB6 to .NET. It used tab controls in
VB6
to achieve a tab dialogue / wizard type effect - navigating from one tab
to
the next as the user filled in information.

When this has upgraded to .NET the user can suddenly click on the other
tabs
without having completed the previous tabs i.e. the other tabs are not
disabled - only the controls on them are.

How do I disable and/or hide a tab page so that the user cannot navigate
to
them by clicking on the tab ?

Regards
Michael

Nov 1 '05 #3
owslachief
1 New Member
I created a copy of both the tab control and it's child tab pages collection. I removed the last two pages (the ones I wanted to "hide") from the collection, removed the original tab control, and added the new tab control with the "mini" version.


Dim MiniTab As System.Windows. Forms.TabContro l
MiniTab = tabBenefits
Dim colTabs As New
System.Windows. Forms.TabContro l.TabPageCollec tion(MiniTab)
colTabs = MiniTab.TabPage s
colTabs.Remove( MiniTab.TabPage s(MiniTab.TabPa ges.Count - 1))
colTabs.Remove( MiniTab.TabPage s(MiniTab.TabPa ges.Count - 1))
Controls.Remove (tabBenefits)
Controls.Add(Mi niTab)
Apr 6 '06 #4

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

Similar topics

1
1253
by: genc ymeri | last post by:
Hi, I'm running in a strange "problem" .... I'm trying to hide a page in tabcontrol with this command " tabMyPage.Hide();" but it still shows up. Am I missing something ??
0
1163
by: Colin | last post by:
Hey all, I'm having a bit of an issue with the TabControl (1.0.5000.0) under Visual Studio .NET 2003... Was wondering if anyone had seen it before... Basically, I have drawn a TabControl, and then added 8 pages to the TabPages collection... Once I do that, I draw a set of eight TextBox's and eight Label's.
2
2350
by: Francois Vanderseypen | last post by:
Can someone tell me why you cannot drag something onto a tabcontrol with zero tabpages? I have a kind of 'docking' interface and relies heavily on GDI+, a screenshot is available here: http://netron.sourceforge.net/Biotron3Shot.jpg You can move tab pages in the different panes, unless it's totally empty (TabCount=0). Is there an alternative? Thanks a lot,
5
9170
by: Mike Fellows | last post by:
I have a TabControl (TabControl1) containing 3 TabPage's (TabPage1, TabPage2 and TabPage3) under certain circumstances i need to make some of these tab pages invisible ive tried me.tabpage1.visible = false but nothing happens and the tab pages is still visible
2
999
by: ASGMikeG | last post by:
Hi, I'm upgrading an application from VB6 to .NET. It used tab controls in VB6 to achieve a tab dialogue / wizard type effect - navigating from one tab to the next as the user filled in information. When this has upgraded to .NET the user can suddenly click on the other tabs without having completed the previous tabs i.e. the other tabs are not disabled - only the controls on them are. How do I disable and/or hide a tab page so that...
2
1697
by: Kevin | last post by:
Although lots of people described how to workaround the lack of ability to hide and show tab pages on a tab control, I couldnt find a code example so I made one. Create a class that inherits from the tabcontrol and then add the following Private htVisibleVal As New Hashtable Private htVisibleKey As New Hashtable Private htInvisibleKey As New Hashtable 'stores the current tabpages
3
1948
by: ohmmega | last post by:
since its common knowledge that it's not possible to hide a tabcontrol tab, i made a collection for removed pages including their tabcontrols. removing works pretty fine, but whenever i try to add a page (timer triggered) i get stuck: System.ArgumentException the message is like: controls, created for a thread cannot superordinate controls from another thread.
2
6275
by: Claudia Fong | last post by:
Hi, I added a tabcontrol in a panel in my form. My tabcontrol have more than 3 pages.. each page contains textboxes, combobox, checkbox. I want to disable the items of each of the page of the tabcontrol (so that the user won't be able to change the values in the textboxes, combobox, checkbox) without the tabcontrol turn into grey.
0
9577
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10569
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
10325
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
10315
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
10075
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6847
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
5651
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4295
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
2
3815
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.