Determine whether a page on tab control is active

  • Thread starter Thread starter Karen
  • Start date Start date
K

Karen

It can't be this hard but---------------I need to know when I'm on a
particular page of a tab control. I've tried


if TabCtl0.Pages(0).InSelection = true then...........

but I get an error 'This property is only available in design time'

What code can I use to determine that I've moved to a certain page of a tab
control?
 
It can't be this hard but---------------I need to know when I'm on a
particular page of a tab control. I've tried


if TabCtl0.Pages(0).InSelection = true then...........

but I get an error 'This property is only available in design time'

What code can I use to determine that I've moved to a certain page of a tab
control?

You can check the .Value property of the tab control:

Me.tabControl.Value

This will return a zero-based index number indicating which tab is currently
selected.
 
Bruce,

Thanks, works like a charm

--
Karen

Bruce M. Thompson said:
You can check the .Value property of the tab control:

Me.tabControl.Value

This will return a zero-based index number indicating which tab is currently
selected.
 
Back
Top