Click Event on Tab Control

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need an event to fire upon the user selecting one of the tabs on a tab
control. It seemed simple enough -- there is a click event for each tab. I
wrote the following code:

Private Sub pgCodeReview_Click()
MsgBox "Click pgCodeReview"
End Sub

But when I run the form, clicking on the tab has no effect. I have put
similar code into the MouseDown event for the same tab, but the code never
runs. How can I get these tabs to fire the Click or the MouseDown event?
 
Sheldon Penner said:
I need an event to fire upon the user selecting one of the tabs on a
tab control. It seemed simple enough -- there is a click event for
each tab. I wrote the following code:

Private Sub pgCodeReview_Click()
MsgBox "Click pgCodeReview"
End Sub

But when I run the form, clicking on the tab has no effect. I have
put similar code into the MouseDown event for the same tab, but the
code never runs. How can I get these tabs to fire the Click or the
MouseDown event?

Use the Change event of the tab control itself.
 
Never mind my question of a few minutes ago. The Value property is what I'm
looking for. Thanks again.

Sheldon
 
Back
Top