 |
Captain Stag Level: Graduate
 Registered: 23-08-2004 Posts: 9
|
Re: Gray RGB
If you are after a specific gray from the system colours, then you can get the RGB quickly by either:
Object Browser > SystemColorConstants
This lists all the enum names and values
or
In a new project change teh fore/backcolor property of any object, and the RGB is stated in the property window (in Hex)
If you want to define your own gray, then all the varying shades are defined by an RGB where the R,G,B are equal
RGB(0,0,0) gives Black
RGB(255,255,255) gives white
Hope this helps
|
|
18-02-2005 at 09:50 AM |
|
|
~Bean~ Level: VB Guru

 Registered: 07-04-2003 Posts: 488
|
Re: Gray RGB
I've been working in Notepad so long you almost had me...
If I'm not mistaken, I believe that the color constants you refer to are merely a reference to the computers Windows settings for color...in other words, when you look at the "BackColor" for, say, a Form, it will say (by default) "&H8000000F&"...this is VB's way of saying to look to such and such Windows setting for the actual color...it's not actually defining the color. What says "&H8000000F&" may be gray on my computer, but could be Blue or Green on someone elses (depending on what their Windows settings are).
You can set an actual Hex color in the "BackColor" property, and the way to tell if this has been done is the first 3 digits of the property will be "H00" (as opposed to "H80")....the last 6 digits then being the HEX color...
What I am looking for is the exact RGB for that blah gray...you know, standard button face, HTML button face, scrollbars, Windows taskbar, etc.
Believe you me I know how to determine RGB and HEX color codes, but cannot get the shade exact (old eyes )...the closest I have is #B6B291...
(yes, I am that anal that I must have the exact shade)
____________________________
Eggheads unite! You have nothing to lose but your yolks.
|
|
19-02-2005 at 12:09 AM |
|
|
Goran Level: Moderator
 Registered: 16-05-2002 Posts: 1681
|
Re: Gray RGB
you can use GetSysColor API, which takes defined system constant as a parameter, and the return value is RGB value
GetSysColor
____________________________
If you find the answer helpful, please mark this topic as solved.
|
|
19-02-2005 at 12:36 AM |
|
|
|
|
 |
 |