473,379 Members | 1,511 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,379 software developers and data experts.

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 23009
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******@discussions.microsoft.com> wrote in message
news:4E**********************************@microsof t.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******@discussions.microsoft.com> wrote in message
news:4E**********************************@microsof t.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
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.TabControl
MiniTab = tabBenefits
Dim colTabs As New
System.Windows.Forms.TabControl.TabPageCollection( MiniTab)
colTabs = MiniTab.TabPages
colTabs.Remove(MiniTab.TabPages(MiniTab.TabPages.C ount - 1))
colTabs.Remove(MiniTab.TabPages(MiniTab.TabPages.C ount - 1))
Controls.Remove(tabBenefits)
Controls.Add(MiniTab)
Apr 6 '06 #4

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

Similar topics

1
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
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...
2
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: ...
5
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...
2
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...
2
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...
3
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...
2
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...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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?

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.