Results 1 to 7 of 7
  1. #1
    4 Star Lounger
    Join Date
    Jan 2003
    Location
    Central Florida, USA
    Posts
    505
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Changing Tab Control Colors (Access 97/2k)

    I have a request from a customer, that some of you may have addressed in the past. I couldn't find an answer by searching so am asking. If it has been previously asked and answered, I apologize.
    We have a form that uses a tab control with six "tabs"/pages. The customer would like the tab to change color so they can tell at a glance which tab they are working on.

    Any help is GREATLY appreciated.

    Respecfully,
    Kwvh

  2. #2
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,623
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: Changing Tab Control Colors (Access 97/2k)

    There was a recent discussion on a similar question where the solution involved applying a colored rectange over the tab, but I didn't find it in a quick search. The bottom line is it isn't easy to do - though the precedence associated with a selected tab does make it fairly clear. Unfortunately tabs are always going to be gray, even if you make the tab control transparent. I suspect based on the previous post may hold a clue, but be sure to charge your customer a bunch - otherwise one of our customers may hear about it and want it too. (I found the previous discussion <post#=214389 >post 214389 </post#>.)
    Wendell

  3. #3
    4 Star Lounger
    Join Date
    Jan 2003
    Location
    Central Florida, USA
    Posts
    505
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Re: Changing Tab Control Colors (Access 97/2k)

    Thanks Wendell,

    I found a "low tech" solution that looks promising. A five point red line beneath the text on the tab. Seems to meet the need. I will show them on Monday and see if I can get their blessing.

    Kwvh

  4. #4
    Bronze Lounger
    Join Date
    Nov 2001
    Location
    Arlington, Virginia, USA
    Posts
    1,394
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Re: Changing Tab Control Colors (Access 97/2k)

    About the only way to do this, unless you obtain some 3rd-party ActiveX add-in that provides this functionality, is to use bitmaps for each Tab Page's Picture property, and toggle this property on the Tab Control's On Change event procedure. See my previous post: <!post=Re: Tab Control (AC2K),184052>Re: Tab Control (AC2K)<!/post> for one example. Code would look like this:

    Private Sub TabCtl1_Change()

    Dim strPath As String
    strPath = "C:ACCESSICONS"

    With Me
    Select Case .TABCTL1
    Case 0
    .Page1.Picture = strPath & "TAB1_YELLOW.BMP"
    .Page2.Picture = strPath & "TAB2_GREY.BMP"
    Case 1
    .Page1.Picture = strPath & "TAB1_GREY.BMP"
    .Page2.Picture = strPath & "TAB2_YELLOW.BMP"
    End Select
    End With

    End Sub

    Note that when images are "toggled" the screen can sometimes flash slightly; with six tab pages, this effect may be exacerbated somewhat. For simple demonstration of this technique, see attached sample db (A2K format) (see frmTabControl3); you will need to copy the bitmap files in zip file to a folder named "C:AccessIcons" (or modify sub to other location). Also with six tabs it'll involve a bit of work to create & size all the little bitmaps needed for this sophisticated technique (aka kludge) to work (I originally typed tab captions in Word, applied formatting, captured screen shot, then cropped & manipulated the bitmaps in MS Paint).

    I should note that the tab page's Caption property normally would make it evident which tab is selected....

    HTH
    Attached Files Attached Files

  5. #5
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Changing Tab Control Colors (Access 97/2k)

    Hi kwvh

    Want to share your (how to) solution to others on the forum?

    Thank,s John

  6. #6
    4 Star Lounger
    Join Date
    Jan 2003
    Location
    Central Florida, USA
    Posts
    505
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Re: Changing Tab Control Colors (Access 97/2k)

    John asked for my "solution". Obviously I didn't do a very good job explaining it. LOL

    The Opportunity:
    My customer(s), like me, are over 40 and therefore "age related visually challenged". In addition, the resolution of their monitors are not the best in the world. With a good monitor and good eyes, it is not difficult to see which tab is on top, but they have neither great monitor nor good eyes.

    The properties of the labels on the form are set so they change colors when the user is in a field/control. This makes it very easy for the user to determine what field the cursor resides in. This was probably my undoing, as they really like that feature and it works very well in 97. (can't use it in Access 2k due to screen flash issue that Mark mentions).

    Because it is easy to tell which FIELD they are in, they want be able to tell at a glance what TAB they are on.
    [For the life of me I don't know why. If they know what field, what difference does it make what tab? But that is another issue. I am here to serve.]

    The Solution: (Remember, I did say it was low tech)
    I put a wide (five point) red horizontal line beneath the text on each of the tabs.

    The forms have a gray background with little or no color on the controls or labels. As they tab through the pages, it is immediately obvious which is the current tab as there is a bright red line at the top "underling" the text on the tab indicating the "active" tab.

    The Results:
    Emailed sample to customer to review, and set up appt for Monday to meet and discuss. Got email back this morning that is exactly what they wanted. So Monday, there is no need to meet, just install. kewl! Sometimes I have a tendency to make things more complicated than necessary.

    Thanks for ALL the help so many have given me these last weeks. This is a great community of folks.

    Ken

  7. #7
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: Changing Tab Control Colors (Access 97/2k)

    Your simple solution prompted me to think another similar one.
    Put a single line above the tab control and move in it code.
    <pre>Private Sub TabCtl0_Change()
    Me!Line5.Left = (Me!TabCtl0.Value) * 700
    End Sub
    </pre>

    Regards
    John



Posting Permissions

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