I have a Form1, and placed SSTab1 on it (with default 3 Tabs)
on very first Tab (Tab 0) I placed Label1
I have this very simple code:
What I want is: no matter which Tab is selected at design time, I want to go thru SSTab1_Click event on Form_Load. Why? There are certain settings I have in SSTab1_Click event and I want first Tab (tab 0) to be always selected when Form starts.
The interesting part here is:
If during design time I select second tab (Tab 1) (or any other tab but Tab 0) and run my code, SSTab1.Tab = 0 in Form_Load 'kicks in' and Tab 0 is selected and my label is red. Great.
But...
If during design time I select first tab (Tab 0) and run my code, code in Form_Load is 'ignored' and my label is black, not red. :-(
So I have to bery careful to save my Form with Tab1 or 2 selected in order for my Form to work the way I want.
What's going on?
Have fun.
---- Andy
A bus station is where a bus stops. A train station is where a train stops. On my desk, I have a work station.
on very first Tab (Tab 0) I placed Label1
I have this very simple code:
Code:
Option Explicit
Private Sub Form_Load()
SSTab1.Tab = 1
SSTab1.Tab = 0
End Sub
Private Sub SSTab1_Click(PreviousTab As Integer)
If SSTab1.Tab = 0 Then
Label1.BackColor = vbRed
End If
End Sub
What I want is: no matter which Tab is selected at design time, I want to go thru SSTab1_Click event on Form_Load. Why? There are certain settings I have in SSTab1_Click event and I want first Tab (tab 0) to be always selected when Form starts.
The interesting part here is:
If during design time I select second tab (Tab 1) (or any other tab but Tab 0) and run my code, SSTab1.Tab = 0 in Form_Load 'kicks in' and Tab 0 is selected and my label is red. Great.
But...
If during design time I select first tab (Tab 0) and run my code, code in Form_Load is 'ignored' and my label is black, not red. :-(
So I have to bery careful to save my Form with Tab1 or 2 selected in order for my Form to work the way I want.
What's going on?
Have fun.
---- Andy
A bus station is where a bus stops. A train station is where a train stops. On my desk, I have a work station.