Easy: On Click for Tab Controls

J

Jimmy

Hello,

Thank you for helping.

When my users click on a new tab (page) in a tab control,
I need to run some code. However, I cannot get the "On
Click" event for the page to fire when I hit the tab
itself. It only fires when I click on the page itself
(not the page's tab).

Does anyone have any ideas?

Thanks,

Jim
 
R

Rick Brandt

Jimmy said:
Hello,

Thank you for helping.

When my users click on a new tab (page) in a tab control,
I need to run some code. However, I cannot get the "On
Click" event for the page to fire when I hit the tab
itself. It only fires when I click on the page itself
(not the page's tab).

Common question. You need to use the Change event of the entire
TabControl, not an event for a specific page. If you only want the code to
run when a particular page is selected you can test the Value property of
the TabControl. It corresponds to the index value of the current page.
 
J

Jimmy

Rick,

Wow, that was so easy, I can't believe it. Thank you
very much for the help.

Jim
 

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