kejpa Posted October 21, 2004 Posted October 21, 2004 Hi, I'm probably too worked out to see what's wrong. I can't hide one of the tabs of my tabcontrol. tabSecret1.Visible=false tabSecret1.Hide don't change a thing, the secret tab is still there :( Help me, plz! /Kejpa Quote
Rick_Fla Posted October 21, 2004 Posted October 21, 2004 From things I have read, you have the visable property, but it does not work. The only way to hide the tab is to remove it at run time, then add it when you want it displayed. I could be wrong though. Here is a link you might want to check out. At the bottom is suppose to be a project that shows a way to hide tabs on a tab control. http://www.devcity.net/forums/topic.asp?tid=81411 Quote "Nobody knows what I do until I stop doing it."
kejpa Posted October 21, 2004 Author Posted October 21, 2004 From things I have read' date=' you have the visable property, but it does not work. [/quote'] That's wonderful.... Sometimes I get the notion that the first release of .NET actually was a beta with the bugs commented out. There are just sooo many things that isn't working that used to work in VB6. Setting the parent to Nothing hides the tabpage, setting it back to the original control makes it reappear, but not in it's normal position. Guess we have to live with this. /Kejpa Quote
Rick_Fla Posted October 21, 2004 Posted October 21, 2004 Yes, strange how something you would think would have been added is now something you have to use a workaround for. Good 'ol MS. Quote "Nobody knows what I do until I stop doing it."
*Gurus* divil Posted October 21, 2004 *Gurus* Posted October 21, 2004 TabPages only have a Visible property because they inherit from Control. The TabControl uses it internally so that only the selected tab is visible, the rest are hidden. If the Visible property was changed to indicate tab visibility, how would it show/hide the different pages depending on which tab was selected? Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
kejpa Posted October 22, 2004 Author Posted October 22, 2004 TabPages only have a Visible property because they inherit from Control. Alright, they inherit from Control and that's why it's there, but MS could have chosen to have it declared Protected or Private then it wouldn't have been visible, no? The TabControl uses it internally so that only the selected tab is visible' date=' the rest are hidden. If the Visible property was changed to indicate tab visibility, how would it show/hide the different pages depending on which tab was selected?[/quote'] I got curious about this and it's true. This way you can change which page is visible without changing the header. <ironi>Now THAT's a feature we've longed for...</ironi> Maybe I'm too quick to judge but when do you need/want this?!?!? The old VB6 tabcontrol had a property (TabVisible(index)) you could use to show/hide tabs. Why didn't it make the .NET cut? I for one use it frequently to show/hide tabs depending on the user priviledges. /Kejpa Quote
*Gurus* divil Posted October 22, 2004 *Gurus* Posted October 22, 2004 Alright' date=' they inherit from Control and that's why it's there, but MS could have chosen to have it declared Protected or Private then it wouldn't have been visible, no?[/quote'] No. You cannot hide an already public member in a derived class. The TabControl wasn't based on the VB6 one, it was based on the Win32 one. It's a useful suggestion but the effort required to implement it probably outweighs its usefulness, especially since you can just remove and add tabs easily. Taking care of their relative positions requires very little code. You can submit suggestions for future versions at http://lab.msdn.microsoft.com/productfeedback/default.aspx Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
kejpa Posted October 22, 2004 Author Posted October 22, 2004 The old VB6 TabStrip sucked, can't understand why they used it as base for a new TabControl. The old TabbedDialog had everything the TabStrip had + a number of useful features. IMHO I guess I will submit some suggestions at the page you pointed me to. Thanx for your effort /Kejpa Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.