Results 1 to 13 of 13

Thread: TabStrip Question

  1. #1

    Thread Starter
    Member
    Join Date
    Jun 2002
    Posts
    44

    TabStrip Question

    Can anyone tell me how I set one tab on the tab strip to be pressed down when a form loads?

  2. #2
    Addicted Member Mage's Avatar
    Join Date
    Jan 2003
    Location
    London- Org SA
    Posts
    134
    sstab1.tab = 0 or
    sstab1.tab = 1 or
    sstab1.tab = 2 or

  3. #3

    Thread Starter
    Member
    Join Date
    Jun 2002
    Posts
    44
    Originally posted by Mage
    sstab1.tab = 0 or
    sstab1.tab = 1 or
    sstab1.tab = 2 or
    I'm using the tabstrip though, not the sstab one??

  4. #4
    Let me in .. techyspecy's Avatar
    Join Date
    Aug 2002
    Location
    Back to VBF.
    Posts
    2,456
    Originally posted by peach12
    I'm using the tabstrip though, not the sstab one??
    thats the point, why are you using TabStrip and not Sstab ?

  5. #5

    Thread Starter
    Member
    Join Date
    Jun 2002
    Posts
    44
    Originally posted by techyspecy
    thats the point, why are you using TabStrip and not Sstab ?
    I didn't know about sstab until now and I have a load of frames and everything on the tabstrip so I don't really want to change it

  6. #6
    Let me in .. techyspecy's Avatar
    Join Date
    Aug 2002
    Location
    Back to VBF.
    Posts
    2,456
    Originally posted by peach12
    I didn't know about sstab until now and I have a load of frames and everything on the tabstrip so I don't really want to change it
    Well then god bless you.

  7. #7
    Addicted Member Mage's Avatar
    Join Date
    Jan 2003
    Location
    London- Org SA
    Posts
    134
    I would copy all your frames over to an sstab.

  8. #8
    PowerPoster
    Join Date
    Aug 2000
    Location
    IN SILENCE
    Posts
    6,441

    Well

    Although I do agree that SSTAB control is better, I will answer the question you asked...

    Assumes TabStrip with 3 tabs :

    VB Code:
    1. Private Sub TabStrip1_Click()
    2.    
    3.     If Me.TabStrip1.Tabs(1).Selected = True Then
    4.        
    5.         MsgBox 1
    6.        
    7.     ElseIf Me.TabStrip1.Tabs(2).Selected = True Then
    8.        
    9.         MsgBox 2
    10.        
    11.     ElseIf Me.TabStrip1.Tabs(3).Selected = True Then
    12.        
    13.         MsgBox 3
    14.        
    15.     End If
    16.    
    17. End Sub
    Remaining quiet down here !!!

    BRAD HAS GIVEN ME THE ULTIMATIVE. I have chosen to stay....

  9. #9
    old fart Frans C's Avatar
    Join Date
    Oct 1999
    Location
    the Netherlands
    Posts
    2,926
    James, that code does not select a tab on form load.

    I think he means something like this:

    VB Code:
    1. Private Sub Form_Load()
    2.     TabStrip1.Tabs(2).Selected = True ' selects second tab
    3. End Sub

  10. #10
    Addicted Member stewie's Avatar
    Join Date
    Jan 2003
    Location
    England
    Posts
    198
    i find sstab is much better to use

    only people from jamie's kitchen use tab strip
    The internet is a great tool. Many people like me suffer in the real world when there are so many people with the "O he is so good looking he has no troubles, why help him out with anything" attitude.

  11. #11
    PowerPoster
    Join Date
    Aug 2000
    Location
    IN SILENCE
    Posts
    6,441

    Well

    Originally posted by Frans C
    James, that code does not select a tab on form load.

    I think he means something like this:

    VB Code:
    1. Private Sub Form_Load()
    2.     TabStrip1.Tabs(2).Selected = True ' selects second tab
    3. End Sub
    Sorry, I misread...

    I thought the goal was to determine clicked tab...
    Remaining quiet down here !!!

    BRAD HAS GIVEN ME THE ULTIMATIVE. I have chosen to stay....

  12. #12
    old fart Frans C's Avatar
    Join Date
    Oct 1999
    Location
    the Netherlands
    Posts
    2,926
    Originally posted by stewie
    i find sstab is much better to use

    only people from jamie's kitchen use tab strip
    I agree with you in most cases. I only use the tabstrip, if multiple tabs share the same controls, and I only need the strip, and the click event (to modify the data in the controls).

  13. #13
    PowerPoster BruceG's Avatar
    Join Date
    May 2000
    Location
    New Jersey (USA)
    Posts
    2,657
    I believe this is what you're after (substitute "2" for whatever tab you want to be selected):
    VB Code:
    1. Set TabStrip1.SelectedItem = TabStrip1.Tabs(2)
    "It's cold gin time again ..."

    Check out my website here.

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