Click Event on Tab Control

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?
 
D

Dirk Goldgar

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.
 
G

Guest

Thank you, Dirk. Can you tell me, please, how do I determine which page was
selected?
 
G

Guest

Never mind my question of a few minutes ago. The Value property is what I'm
looking for. Thanks again.

Sheldon
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top