469,363 Members | 2,560 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,363 developers. It's quick & easy.

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.
Feb 21 '08 #1
2 1310
446 Expert 256MB
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
Expand|Select|Wrap|Line Numbers
  2. 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.

Feb 27 '08 #2
32,185 Expert Mod 16PB

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

Mar 3 '08 #3

Post your reply

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

Similar topics

1 post views Thread by Dean J Garrett | last post: by
reply views Thread by Bryce Budd | last post: by
2 posts views Thread by Cliff Lane | last post: by
reply views Thread by WhiteWizard | last post: by
5 posts views Thread by Arpan | last post: by
2 posts views Thread by Xavier | last post: by
7 posts views Thread by Brian | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.