Events on a tab page

D

Darrell

I seem to be unable to get any response to the click event
for a tab page. I set a simple MsgBox to execute On Click
for a page, and break at the procedure, and clicking the
tab produced absolutely no response. What am I doing wrong?
 
R

Rick Brandt

Darrell said:
I seem to be unable to get any response to the click event
for a tab page. I set a simple MsgBox to execute On Click
for a page, and break at the procedure, and clicking the
tab produced absolutely no response. What am I doing wrong?

You are expecting MS to use intuitive logic :).

You are actually doing nothing wrong except that you are expecting the
"tab" of a tab page to be considered part of the tab page and it is not.
Therefore clicking on it does not fire the click event of the page. You
have to click in the blank main area of a tab page to get its Click event
to fire which makes it a rather useless event.

Instead use the Change event of the entire tab control. That fires
whenever you change tab pages (whether by clicking on a tab or otherwise).
In that event you can test the value property of the tab control to
determine which tab page was just "brought to the front" and in that way
have page-specific code executed.
 
D

Darrell

Thank you, Rick. That was a very enlightening reply. It
will be helpful on more than one occasion, I am sure. I
will attempt to stop expecting MS to use intuitive logic :-
).

Darrell
 

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