Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to handle an "enter" event into a TabPage 1

Status
Not open for further replies.

RebLazer

Programmer
Jun 7, 2002
438
0
0
US
I have a TabControl with several TabPages. What I am trying to do is as soon as the user clicks on the little tab-thingy specifically (as opposed to anywhere on the TabPage) it should execute some code.

This is what I currently have:

[tt] Private Sub match_orgs_tbpg_Enter(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles match_orgs_tbpg.Enter
Button1.Text = "you are here"
End Sub[/tt]

It doesn't work. That code only executes when the user clicks on a WebControl on the TabPage - but I want it to execute as soon as the user selects the TabPage itself.

Is [tt].enter[/tt] the correct EventHandler to use? How can this be done properly?

Thanks so much,
Lazer
 
It looks like you are using tabpage events. You need to use tabcontrol events:

SelectedIndexChanged (for a changing tab pages)
or
Click (for a click event on the tab of the current tab page)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top