Results 1 to 6 of 6
  1. #1
    3 Star Lounger
    Join Date
    Jun 2002
    Location
    Nottingham, Nottinghamshire, United Kingdom
    Posts
    257
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Matching the button colour (A2000)

    Recently I upgraded my hardware and improved the screen and graphics. I have now realised that most of my forms look awful because the grey I have used for most of the text boxes, and some backgrounds, is different from the grey of buttons. When I select grey from the toolbar dropdown I get a background of 12632256 whereas the button background is minus2147483633. This value can't be selected from the colour swatch (I don't even understand why it is a minus number). Is there an easy way of selecting the button grey colour without having to enter the colour code manually?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Matching the button colour (A2000)

    Hi David,

    The negative color values are the system colors you can set in the Appearance tab of the Display Properties control panel. These are not fixed colors, but depend on the user's individual settings. Buttons may be grey in your Windows, but purple in somebody elses. The color value is -2147483633 in all cases. You can find the values involved as follows:

    Switch to the Visual Basic Editor (Alt+F11) (don't worry, there is no programming involved)
    Activate the Object Browser (F2)
    Type systemcolor into the search box and press Enter.
    You will see a list of SystemColorConstants named vb3DDKShadow etc.
    If you click on one of them, you will see its value in the lower pane of the Object Browser.
    You can select this value and copy it to the clipboard (Ctrl+C)
    The button color is vbButtonFace. Other useful constants are vbButtonText (the color of the caption of a button - default is black), vbWindowBackground (the standard background color of a window in an application - default is white) and vbWindowText (the standard color of text - default is black).

  3. #3
    3 Star Lounger
    Join Date
    Jun 2002
    Location
    Nottingham, Nottinghamshire, United Kingdom
    Posts
    257
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Matching the button colour (A2000)

    Hi Hans

    Thanks for the explanation. I have changed my default Windows colours to make matching easier. I hadn't realised that buttons could be any other colour and it certainly makes the job of tying down the design of forms much harder if in fact users can change elements that Access doesn't allow us to change.

    In code I've now found a new set of constants thanks to your advice and will use them in my code instead of the constants I have defined myself for colours. Its a pity though that we can't use these vb constants in properties dialogs whilst we are designing forms.

    Again many thanks

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Matching the button colour (A2000)

    >> Its a pity though that we can't use these vb constants in properties dialogs whilst we are designing forms.

    It certainly is a nuisance (even in Access 2002.) Strangely enough, you can choose between system colors and palette colors (fixed colors) when designing UserForms in other Office applications and in VB6 (see screenshot).
    Attached Images Attached Images
    • File Type: png x.PNG (5.6 KB, 0 views)

  5. #5
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Matching the button colour (A2000)

    But remember, Access uses different forms and controls from VB and the rest of Office. <img src=/S/shrug.gif border=0 alt=shrug width=39 height=15>
    Charlotte

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Matching the button colour (A2000)

    I know, but it would be very convenient to be able to select a system color directly instead of copying and pasting from the Object Browser or typing the value directly. It shouldn't be too difficult for the Access group inside Microsoft to get a copy of the VB color select dialog from their colleaugues.

Posting Permissions

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