Image Change with Tab Control

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Wayneyh
    New Member
    • Mar 2008
    • 67

    Image Change with Tab Control

    Hi All

    How do i change an image with a Tab Control. I have a Tab Control with 6 pages
    and want to change an image in the Form Header depending on which tabbed page is being edited. I have tried several ways with vb but only get the first image. Please advise.

    Regards

    Wayne
  • missinglinq
    Recognized Expert Specialist
    • Nov 2006
    • 3533

    #2
    The first thing to understand is that tabbed pages are indexed starting with zero, i.e. the first page has a value of 0, second page has a value of 1, third page has a value of 2, etc.

    Secondly, you need to understand that the OnClick event of a tabbed page only fires when you click on the page itself, not the tab at the top of the page!

    Lastly, you need to understand that the tabbed control Change event fires anytime the tabbed pages change. But to base something on the Change event, you have to identify the particular page that has focus.

    [CODE=vb]Private Sub YourTabbedContr ol_Change()
    If Me.YourTabbedCo ntrol.Value = 0 Then ‘First Page
    'Assign image for first page
    ElseIf Me.YourTabbedCo ntrol.Value = 1 Then ‘Second page
    'Assign image for second page
    ElseIf Me.YourTabbedCo ntrol.Value = 2 Then ‘Third page
    'Assign image for third page
    End If
    End Sub[/CODE]

    Linq ;0)>

    Comment

    • Wayneyh
      New Member
      • Mar 2008
      • 67

      #3
      Thanks missinglinq

      That works great now.

      Best regards

      Comment

      • missinglinq
        Recognized Expert Specialist
        • Nov 2006
        • 3533

        #4
        Glad we could help!

        Linq ;0)>

        Comment

        Working...