Get current page index in tab control

M

moondaddy

I'm writing a winforms app in vb.net 1.1 and have a tab control on one of
the forms. each time a different page is selected in the tab control I need
to run code in the form for that particular page. how can I determine which
tab or page was selected. I tried using the TabIndexChanged event, but it
doesn't fire when I click on a different tab.

any ideas?

Thanks
 
G

Gary Chang

Hi,
how can I determine which tab or page was selected. I tried using the
TabIndexChanged event, but it doesn't fire when I click on a different tab.
To determine which tab or page was selected, you can handle the
TabControl.SelectedIndexChanged event and query its SelectedIndex property:
this.tabControl1.SelectedIndex

Regarding as the TabIndexChanged event, it would be raised if the TabIndex
property(Tab order of the controls within a Winform) is changed by either a
programmatic modification or user interaction:
Changing the Tab Order of Controls
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vcresed/htm
l/_asug_changing_the_tab_order.asp


Thanks!

Best regards,

Gary Chang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
 
M

moondaddy

Thanks that's exactly what I was looking for. for some reason, my eyes
didn't see that property in the property list.
 
G

Gary Chang

Well, I am glad that I can help you find the property you wanted.


Good Luck!

Best regards,

Gary Chang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
 

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