Win Color v1.0 is a simple sample of how to access and use the WIN.INI 
[Colors] section to define to BackColor, BorderColor, and ForeColor of 
MS-Access Form Objects. It is plain Access Basic code with no additional
custom controls, all the special work is done using an API call.

For those of you who have built a user interface for someone other than 
yourself, you know how difficult is can be to get those colors just right.  
This utility allows your MS-Access Forms to inherit the color properties 
from your users Windows Environment (with minimal coding effort).

There are 21 color options defined in the WIN.INI.  These values can be set by 
the user from the Color Icon in the Control Panel.  The Section Entry choices 
and their descriptions are as follows:

ActiveBorder        - Active form or window border
ActiveTitle         - Active form or window title, caption, or header field
AppWorkspace        - Form or window field
Background          - Windows workspace background
ButtonFace          - Button face or field
ButtonHilight       - Button hi-light (top-left part of 3-D)
ButtonShadow        - Button shadow (bottom-right part of 3-D)
ButtonText          - Text on a button
GrayText            - Disabled menu text
Hilight             - Hi-light bar in menu options
HilightText         - Hi-light text in menu bar options
InactiveBorder      - Inactive form or window border
InactiveTitle       - Inactive form or window title, caption, or header field
InactiveTitleText   - Inactive form or window title, caption, or header text
Menu                - Menu bar
MenuText            - Menu bar text
Scrollbar           - Scrollbar indicator
TitleText           - Form or window title, caption, or header text
Window              - Entry field, child form or window
WindowFrame         - Object frame
WindowText          - Text in the entry field, child form or window

Using these entries, it's easy to apply the Windows Color configuration to 
your Access form.  I have included a sample form that uses most of the windows 
colors.  Take a look and see for yourself.

How to use Win Color v1.0

It could not be easier.  In the Form_Load or Form_Activate Event, change the 
BackColor, BorderColor, or ForeColor object properties.  Here is an example:

Sub Form_Activate ()
 Me.Section(0).BackColor = Win_INI_Color("Background", Me.Section(0).BackColor)
 AppWorkspace.BackColor = Win_INI_Color("AppWorkspace", AppWorkspace.BackColor)
 AppWorkspace.BorderColor = Win_INI_Color("ActiveBorder", Active_Window.BorderColor)
 AppWorkspace_Title.BackColor = Win_INI_Color("ActiveTitle", AppWorkspace_Title.BackColor)
 AppWorkspace_Title.ForeColor = Win_INI_Color("TitleText", AppWorkspace_Title.ForeColor)
End Sub 

In this example, I have a rectangle with the object name of AppWorkspace and a 
label on top with the object name AppWorkspace_Title.  The two parameters I 
pass to the Win_INI_Color function are 1) the entry color definition and 2) 
the default color (if no entry is found in the WIN.INI).

Take a look at the WIN_INI_Colors form for further examples and just to see 
how it works.


Enjoy the application. Feel free to use it in whole or in part as you need.  I 
do not wish any compensation, but would be happy to receive email with any 
questions, comments, etc.  If you find this REAL useful, make a donation to a 
favorite charity.  This code is happily provided to you by:

Richard Hammer
  Internet:  DRGNGLD@AOL.COM
             RHAMMER@CCPACE.COM

Future enhancements:

*    Automatically cycle through all form object names and set the Back, 
     Border, and Fore Colors as appropriate.

*    Tap into the color refresh trigger, so that when the Windows colors are 
     changed from the Control Panel, the Access form is updated automatically
     (as all other MS applications running are).

*    Any others, drop me a line, I'll see what I can do.

