VS 2010 On Tab Control Select-VBForums
Results 1 to 5 of 5

Thread: On Tab Control Select

  1. #1

    Thread Starter
    Member
    Join Date
    Jul 2011
    Posts
    33

    On Tab Control Select

    How can I execute some piece of code when I change the tab of one 'Tab Control' ?

  2. #2
    Addicted Member
    Join Date
    Jan 2012
    Location
    Athens, Greece
    Posts
    143

    Re: On Tab Control Select

    Handle TabControl SelectedIndexChanged event.

    VB.Net Code:
    1. Private Sub TabControl1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles TabControl1.SelectedIndexChanged
    2.         'Your code
    3. End Sub

    (TabControl1 the name of the TabControl)
    Last edited by pkarvou; Feb 2nd, 2012 at 08:50 AM.

  3. #3

    Thread Starter
    Member
    Join Date
    Jul 2011
    Posts
    33

    Re: On Tab Control Select

    Quote Originally Posted by pkarvou View Post
    Handle TabControl SelectedIndexChanged event.

    VB.Net Code:
    1. Private Sub TabControl1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles TabControl1.SelectedIndexChanged
    2.         'Your code
    3. End Sub

    (TabControl1 the name of the TabControl)
    thanks for the reply, how can I execute different lines due to the tab choosed ?
    I tried to use CASE 'Name of Tab1' but it changes it to LCASE

  4. #4
    Bad man! ident's Avatar
    Join Date
    Mar 2009
    Location
    Cambridge
    Posts
    4,125

    Re: On Tab Control Select

    vb Code:
    1. Dim page As String = DirectCast(sender, TabControl).SelectedTab.ToString

  5. #5

    Thread Starter
    Member
    Join Date
    Jul 2011
    Posts
    33

    Re: On Tab Control Select

    thank you =D

Posting Permissions

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



Featured


Click Here to Expand Forum to Full Width

Survey posted by VBForums.