Follow up to question about Tab Control colors

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • maxvernon
    New Member
    • Feb 2008
    • 12

    Follow up to question about Tab Control colors

    http://www.thescripts.com/forum/thread199041.html asks the question "Change background/tab colour of tabControl?". I've been working on this problem for 2 days and have come up with a nice, neat, simply way of doing this that takes almost no pain.

    See ** Removed link to external code ** for a completely free piece of sample code on what to do.

    The source code is for Access 2003 and includes a VB5 ActiveX DLL along with all source code. It should be a fairly trivial process to use this in Access 2007 with VB6. You could even use it just with Access (no VB) with slight modification. The only code that is reliant on VB are the TwipsPerPixelX and TwipsPerPixelY calls, which could be substituted with hard coded values (probably 15 for most monitors).

    TabControls in Microsoft Access do not implement the BackColor property and only implement the BackStyle property when the Access MDB file has "Use Themed Controls" property set to false. If you want to be able to have your TabControl use a transparent background, as I do in my code, you MUST set the "Use Windows Themed Controls on Forms" option to unchecked in Options -> Forms/Reports.
    Last edited by NeoPa; Mar 3 '08, 11:22 PM. Reason: Removed link to external code
  • sierra7
    Recognized Expert Contributor
    • Sep 2007
    • 446

    #2
    Hi again Max

    This is very good but it would be interesting to learn how to detect the version of Access before it gets to the line
    Code:
     
    If AccessApp.GetOption("Themed Form Controls") = 0 Then
    because 2000/2002 crashes there as it does not understand "Themed Form Controls"

    I have recently had problems when porting code from 2000 to 2003, where it would be useful to check for 2003 and turn off the new functionality in 'Autocorrect'.

    In a previous thread in a demo system I copied your code from the DLL into a module within Access to make it unnecessary to register and have reference to an external file. I have not yet had time to checkout Mr.Lebans solution to confirm he can change the colour of the tabs too.

    S7

    Comment

    • NeoPa
      Recognized Expert Moderator MVP
      • Oct 2006
      • 32656

      #3
      Max,

      You are welcome to include your code in a post, but linking offsite to code is not allowed.

      Admin.

      Comment

      Working...