Results 1 to 3 of 3

Thread: [RESOLVED] TabControl and Click Control

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Aug 2005
    Posts
    18

    Resolved [RESOLVED] TabControl and Click Control

    I have a form with a tabcontrol with several tabs.

    When the user clicks on the final tab - I want that tabclick to be the same as the "click" on a command button and run the code ...
    is there an easy way to do this? I can't seem to find a "tab_click" --

    Thanks!

  2. #2
    Frenzied Member conipto's Avatar
    Join Date
    Jun 2005
    Location
    Chicago
    Posts
    1,175

    Re: TabControl and Click Control

    Capture the Tabcontrol.tabindexchanged event.

    Enter a handler in your form startup or main like:
    VB Code:
    1. AddHandler tabControl1.SelectedIndexChanged, AddressOf tab_changed

    Then a sub that does what you want it to do when the last item is clicked, i.e:

    VB Code:
    1. Public Sub tab_changed(ByVal sender As Object, ByVal e As EventArgs)
    2.         If tabControl1.SelectedIndex = tabControl1.TabCount - 1 Then MsgBox("hi")
    3. End Sub

    Bill
    Hate Adobe Acrobat? My Codebank Sumbissions - Easy CodeDom Expression evaluator: (VB / C# ) -- C# Scrolling Text Display

    I Like to code when drunk. Don't say you weren't warned.

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Aug 2005
    Posts
    18

    Re: TabControl and Click Control

    GREAT, thank you!
    I'll give that a shot!

    Worked great ... thank you!
    Last edited by Srtdesign; Aug 7th, 2005 at 08:01 PM.

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