views:

93

answers:

1

I have this program that should execute a piece of code base on the tab that is selected. How do I do it? I've tried:

if tabcontrol1.tabcount=1 then
'Execute this code'

else if tabcontrol1.tabcount=2 then
'execute this code
end if

-But doesn't work, what's the proper way of doing it?

+2  A: 

In the Tabcontrol_selected event you can use the selectedindex property value to get the current tab.

SelectedIndex

Shoban