By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,165 Members | 840 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,165 IT Pros & Developers. It's quick & easy.

Image Change with Tab Control

P: 67
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.


Nov 17 '08 #1
Share this Question
Share on Google+
3 Replies

Expert 2.5K+
P: 3,532
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.

Expand|Select|Wrap|Line Numbers
  1. Private Sub YourTabbedControl_Change()
  2. If Me.YourTabbedControl.Value = 0 Then ‘First Page
  3. 'Assign image for first page
  4. ElseIf Me.YourTabbedControl.Value = 1 Then ‘Second page
  5. 'Assign image for second page
  6. ElseIf Me.YourTabbedControl.Value = 2 Then ‘Third page
  7. 'Assign image for third page
  8. End If
  9. End Sub
Linq ;0)>
Nov 17 '08 #2

P: 67
Thanks missinglinq

That works great now.

Best regards
Nov 17 '08 #3

Expert 2.5K+
P: 3,532
Glad we could help!

Linq ;0)>
Nov 17 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.