views:

160

answers:

1

This page indicates that TabPage has a GotFocus event, but in Visual Studio 2008 I don't see that option on the TabPage (it says it is inherited from the control, i.e. the TabControl).

What event would I use to write some code that runs each time a user clicks on a different tab? Would I use the GotFocus of the TabControl - but in that case, when user switches to different tabs doe sthe GotFocus fire again (and pass me the tabname as a variable?)

+1  A: 

Tabcontrol in Windows.Forms has SelectedIndex Changed-Event and SelectedTab Property.

So registering TabControl.SelectedIndexChanged ask for the TabControl.SelectedTab is all you need.

Steav
Perfect, thanks. I was doing the TabPage Entered and having some issues.
NealWalters