Determine whether a page on tab control is active

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?
 
B

Bruce M. Thompson

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.
 
K

Karen

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.
 

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