Results 1 to 2 of 2

Thread: [RESOLVED] [2008] - TabIndexChanged

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2008
    Posts
    284

    Resolved [RESOLVED] [2008] - TabIndexChanged

    Why does the messagebox only show when the form loads, and not when a different tab is selected?

    vb Code:
    1. Private Sub TabPage1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tabBox.TabIndexChanged
    2.         MessageBox.Show(tabBox.TabIndex)
    3. End Sub
    I am still very new to VB.NET, so I have MANY questions

  2. #2
    Evil Genius alex_read's Avatar
    Join Date
    May 2000
    Location
    Espoo, Finland
    Posts
    5,538

    Re: [2008] - TabIndexChanged

    In an Obi-Wan stylee... "this is not the event you are looking for" You need to interact with the SelectedIndexChanged event instead.
    Code:
    Private Sub TabControl1_SelectedIndexChanged(ByVal sender As Object, _
        ByVal e As System.EventArgs) Handles TabControl1.SelectedIndexChanged
            MessageBox.Show(TabControl1.SelectedIndex)
        End Sub

    Please rate this post if it was useful for you!
    Please try to search before creating a new post,
    Please format code using [ code ][ /code ], and
    Post sample code, error details & problem details

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width