Quick Tabcontrol question

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi

I have a tabcontrol on my form with 4 tabpages
What i want to do is to add 2 textbox values together and put the result in a labe

Im not sure what event i should put this under however
I only want this addition to be performed when tabpage1 is selected

I tried using the TabPage1.click event but it didnt work
Does anyone know the correcyt event?

many thx
 
Tonya said:
Hi,

I have a tabcontrol on my form with 4 tabpages.
What i want to do is to add 2 textbox values together and put the result in a label

Im not sure what event i should put this under however.
I only want this addition to be performed when tabpage1 is selected.

I tried using the TabPage1.click event but it didnt work.
Does anyone know the correcyt event??

SelectedIndex is the event you want. In VB, try something like:

Private Sub TabControl1_SelectedIndexChanged(ByVal sender As Object, ByVal e
As EventArgs) _
Handles TabControl1.SelectedIndexChanged

If TabControl1.SelectedTab Is TabPage1 Then [Do whatever]
End Sub
 
Back
Top