Disable/Enable select tabs 
Author Message
 Disable/Enable select tabs

Greetings, I have a tab control with 4 tabs. Is it possible to make 2
of the tabs "Enabled=False" and back again depending on the condition?

Jim



Fri, 10 May 2002 03:00:00 GMT  
 Disable/Enable select tabs
yes, you could initialize your tabs in the form_load event, and then
in the tab click event you could use the previous tab property to figure
out which tabs to enable/disable. for instance, the code would look like
the following.

Private Sub Form_Load()
'~~~ by default you could disable the tabs based on the index.
'~~~ lets say at first you want only tab 1 and tab 2 enabled and rest
disabled.
SSTab1.TabEnabled(0) = True
SSTab1.TabEnabled(1) = True
SSTab1.TabEnabled(2) = False
SSTab1.TabEnabled(3) = False
'~~~ now follow the code in tab_click event
End Sub

Private Sub SSTab1_Click(PreviousTab As Integer)
On Error Resume Next
'~~~ when the user selects a tab and the previous tab was one the
following:
Select Case PreviousTab
    Case 0: '~~~ user was on first tab ; disable tab 4
    '~~~ note index starts with 0 not 1 ; therefore its always tab-1
    '~~~ this event comes in handy when the user is moving back and forth
between the
    '~~~ tabs.
       SSTab1.TabEnabled(3) = False
    Case 1: '~~~ user was on second tab , enable tab 4 and disable xxxx
        SSTab1.TabEnabled(3) = True
        '~~~ and so on depends on what you intend to do.
End Select
End Sub

hope this helps!
cheers

Quote:

> Greetings, I have a tab control with 4 tabs. Is it possible to make 2
> of the tabs "Enabled=False" and back again depending on the condition?

> Jim



Fri, 10 May 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Disable/Enable select tabs

2. Disable/Enable select tabs

3. Tab Strip control (enabled/disabled)

4. Control Panel/System/Device Manager tab Disable/Enable

5. disabling the DISABLE/ENABLE macros menu on opening spreadsheet

6. disable the enable/disable macro message

7. How to disable CTRL+TAB and CTRL+SHIFT+TAB for switching mdi child windows

8. How to select Tab Control tab page programmatically?

9. Selecting tab on tab strip

10. Newbie: How to select a tab on a tab strip

11. Disable/enable insert key with code?

12. Enable/Disable Users

 

 
Powered by phpBB® Forum Software