Can anyone tell me how I set one tab on the tab strip to be pressed down when a form loads?
Printable View
Can anyone tell me how I set one tab on the tab strip to be pressed down when a form loads?
sstab1.tab = 0 or
sstab1.tab = 1 or
sstab1.tab = 2 or
I'm using the tabstrip though, not the sstab one??Quote:
Originally posted by Mage
sstab1.tab = 0 or
sstab1.tab = 1 or
sstab1.tab = 2 or
thats the point, why are you using TabStrip and not Sstab ?Quote:
Originally posted by peach12
I'm using the tabstrip though, not the sstab one??
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 itQuote:
Originally posted by techyspecy
thats the point, why are you using TabStrip and not Sstab ?
Well then god bless you. :DQuote:
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
I would copy all your frames over to an sstab.
Although I do agree that SSTAB control is better, I will answer the question you asked...
Assumes TabStrip with 3 tabs :
VB Code:
Private Sub TabStrip1_Click() If Me.TabStrip1.Tabs(1).Selected = True Then MsgBox 1 ElseIf Me.TabStrip1.Tabs(2).Selected = True Then MsgBox 2 ElseIf Me.TabStrip1.Tabs(3).Selected = True Then MsgBox 3 End If End Sub
James, that code does not select a tab on form load.
I think he means something like this:
VB Code:
Private Sub Form_Load() TabStrip1.Tabs(2).Selected = True ' selects second tab End Sub
i find sstab is much better to use
only people from jamie's kitchen use tab strip
Sorry, I misread...Quote:
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:
Private Sub Form_Load() TabStrip1.Tabs(2).Selected = True ' selects second tab End Sub
I thought the goal was to determine clicked tab...:o
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).Quote:
Originally posted by stewie
i find sstab is much better to use
only people from jamie's kitchen use tab strip
I believe this is what you're after (substitute "2" for whatever tab you want to be selected):
VB Code:
Set TabStrip1.SelectedItem = TabStrip1.Tabs(2)