If a certain tab is selected then run a code

  • Thread starter Thread starter John
  • Start date Start date
J

John

I wanted to know if there is a way to know when a person
is on a certain tab because I would want to be able to
disable a option group when a certain page is selected.

Thanks in advance,
John
 
John said:
I wanted to know if there is a way to know when a person
is on a certain tab because I would want to be able to
disable a option group when a certain page is selected.

Test the Value property of the TabControl in the TabControl's Change event.
It will correspond to the index property of the TabPage currently "on top".

If Me.TabControlName.Value = 2 Then...

The above would evaluate to true when the TabPage with index value 2
(usually the third page) was selected.
 
Back
Top