Disable TabStrips by User Preference
I have a TabStrip control with 10 prebuilt tabs & a ComboBox Dropdown box with the values 1-10.
I want the user to be able to specify how many tabs are either hidden or disabled (which ever is possible, doesn't really matter which) by chosing 1-10 from then ComboBox Dropdown box.
I already have the tabs constructed and I don't really like usung the SSTab control.
I've been working on this one problem for months now. :eek2:
Thank you.
Re: Disable TabStrips by User Preference
Im not sure, but I think enabled is for all the Tabstrip ???
You can check this link for suggestions...
Re: Disable TabStrips by User Preference
Hi
Just a quick question...
when a user selects 2 from the combobox, then you want two tabstrips to get hidden/disabled or you want the 2nd tab to be hidden/disabled ...
Re: Disable TabStrips by User Preference
Quote:
when a user selects 2 from the combobox, then you want two tabstrips to get hidden/disabled or you want the 2nd tab to be hidden/disabled ...
If the user chooses 2 from the combobox, I want the first two tabs to be enabled/visible and the remaining (in this case, eight) to be disabled/hidden.
DubweiserTM, I tried the disable function, but no luck.
Quote:
If MainOption_NumberOfEvents = 2 Then
TabStrip1.TabEnabled(9) = False
Re: Disable TabStrips by User Preference
Quote:
If the user chooses 2 from the combobox, I want the first two tabs to be enabled/visible and the remaining (in this case, eight) to be disabled/hidden.
DubweiserTM, I tried the disable function, but no luck.
Quote:
If MainOption_NumberOfEvents = 2 Then
TabStrip1.TabEnabled(9) = False
Hi
1) In VB6, TabStrip1 doesn't have a TabEnabled property which you can set to 'False'
2) If you want to hide tabs then you need to use SStab in lieu of tabstrip...
3) If you want to disable them (asin users will not be able to use them) then use the below mentioned code...
VB Code:
Private Sub TabStrip1_Click()
'mycount is the value which is passed from the combobox
For i = mycount + 1 To TabStrip1.Tabs.Count
If TabStrip1.SelectedItem.index = i Then
'This ensures that the focus returns to the 1st tab
TabStrip1.Tabs(1).Selected = True
End If
Next i
End Sub
hope this helps...
Re: Disable TabStrips by User Preference
I am want to use this code to also remove the tab captions.
I am trying to use "TabStrip1.Tabs.Count.Caption = """ but I'm not getting it right.
Can you see what I'm doing wrong?
Thanks.
Re: Disable TabStrips by User Preference
Hi
TabStrip1.Tabs.Count is used to give you the no of tabs in tabstrip... u cannot use .caption property with it...
use the below mentioned code
VB Code:
'where 'i' is the tab no...
TabStrip1.Tabs(i).Caption="your text"
Re: Disable TabStrips by User Preference
Thanks koolsid.
I got another question about the caption.
I want all the "unallowed" tabs to share a similar caption, while the "allowed" tabs have their own.
I tried giving all tabs the same caption, like "UNALLOWED" and then told the program if 01 was selected from the dropdown box, assign that caption as Tab, and if 02 was selected from the dropdown box, assign both tab1 and tab2 as such, and etc.
But this didn't work. Better idea?
Thanks.
Re: Disable TabStrips by User Preference
Quote:
Originally Posted by JBHOnline
But this didn't work. Better idea?
What does this mean? What exactly happened when you tried?
Re: Disable TabStrips by User Preference
Lemme see...
I have a tabstrip control with 10 tabs.
I also have a dropdown box with 10 options, 01, 02, 03, and etc up to 10.
When the user clicks on an option, such as 02, then the first and second tabs are the only tabs of the control the user can access (thanks to koolsid for that help :) ).
I am now trying to set it up so when the user selects an option, again, like option 02, for example, the "allowed" tabs, (tabs 01-02 because it was selected via the dropdown box) shows captions of "Event 01" and "Event 02" and the remaining unselected tabs (in this example, 03-10) are all captioned "DEAD" or whatever.
Im not near my usual computer and so Ican't post the script I have so far this second. If you need it, when I get back, I can post it.
Understand? A little confusing to put in words.