Results 1 to 10 of 10

Thread: Disable TabStrips by User Preference

  1. #1

    Thread Starter
    New Member
    Join Date
    Dec 2006
    Posts
    5

    Question 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.

    Thank you.

  2. #2
    Hyperactive Member DubweiserTM's Avatar
    Join Date
    Dec 2005
    Location
    St-Ferdinand, Québec
    Posts
    427

    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...
    DubweiserTM

    If your question has been answered, you can mark a thread as resolved...

  3. #3
    Discovering Life Siddharth Rout's Avatar
    Join Date
    Feb 2005
    Location
    Mumbai, India
    Posts
    12,001

    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 ...
    Last edited by Siddharth Rout; Dec 22nd, 2006 at 12:17 PM. Reason: spell check...
    A good exercise for the Heart is to bend down and help another up...
    Please Mark your Thread "Resolved", if the query is solved


    MyGear:
    ★ CPU ★ Ryzen 5 5800X
    ★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
    ★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
    ★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
    ★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
    ★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
    ★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
    ★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
    ★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
    ★ Keyboard ★ TVS Electronics Gold Keyboard
    ★ Mouse ★ Logitech G502 Hero

  4. #4

    Thread Starter
    New Member
    Join Date
    Dec 2006
    Posts
    5

    Re: Disable TabStrips by User Preference

    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.
    If MainOption_NumberOfEvents = 2 Then
    TabStrip1.TabEnabled(9) = False

  5. #5
    Discovering Life Siddharth Rout's Avatar
    Join Date
    Feb 2005
    Location
    Mumbai, India
    Posts
    12,001

    Re: Disable TabStrips by User Preference

    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:
    1. Private Sub TabStrip1_Click()
    2. 'mycount is the value which is passed from the combobox
    3. For i = mycount + 1 To TabStrip1.Tabs.Count
    4.     If TabStrip1.SelectedItem.index = i Then
    5.         'This ensures that the focus returns to the 1st tab
    6.         TabStrip1.Tabs(1).Selected = True
    7.     End If
    8. Next i
    9. End Sub

    hope this helps...
    Last edited by Siddharth Rout; Dec 22nd, 2006 at 06:32 PM.
    A good exercise for the Heart is to bend down and help another up...
    Please Mark your Thread "Resolved", if the query is solved


    MyGear:
    ★ CPU ★ Ryzen 5 5800X
    ★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
    ★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
    ★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
    ★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
    ★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
    ★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
    ★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
    ★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
    ★ Keyboard ★ TVS Electronics Gold Keyboard
    ★ Mouse ★ Logitech G502 Hero

  6. #6

    Thread Starter
    New Member
    Join Date
    Dec 2006
    Posts
    5

    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.

  7. #7
    Discovering Life Siddharth Rout's Avatar
    Join Date
    Feb 2005
    Location
    Mumbai, India
    Posts
    12,001

    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:
    1. 'where 'i' is the tab no...
    2. TabStrip1.Tabs(i).Caption="your text"
    Last edited by Siddharth Rout; Dec 25th, 2006 at 10:42 AM.
    A good exercise for the Heart is to bend down and help another up...
    Please Mark your Thread "Resolved", if the query is solved


    MyGear:
    ★ CPU ★ Ryzen 5 5800X
    ★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
    ★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
    ★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
    ★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
    ★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
    ★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
    ★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
    ★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
    ★ Keyboard ★ TVS Electronics Gold Keyboard
    ★ Mouse ★ Logitech G502 Hero

  8. #8

    Thread Starter
    New Member
    Join Date
    Dec 2006
    Posts
    5

    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.

  9. #9
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    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?

  10. #10

    Thread Starter
    New Member
    Join Date
    Dec 2006
    Posts
    5

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width