borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (Midi file to binary file)Next Topic (playing any kind of video in VB!) New Topic New Poll Post Reply
AndreaVB Forum : Multimedia : Gray RGB
Poster Message
~Bean~
Level: VB Guru


Registered: 07-04-2003
Posts: 488

icon Gray RGB

silly question...whats the RGB value for that yummy gray color used on nearly everything? (like command buttons, scroll bars, etc.)

____________________________
Eggheads unite! You have nothing to lose but your yolks.

18-02-2005 at 06:41 AM
View Profile Send Email to User Show All Posts Visit Homepage | Quote Reply
Captain Stag
Level: Graduate

Registered: 23-08-2004
Posts: 9
icon 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
View Profile Send Email to User Show All Posts | Quote Reply
~Bean~
Level: VB Guru


Registered: 07-04-2003
Posts: 488
icon 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
View Profile Send Email to User Show All Posts Visit Homepage | Quote Reply
Goran
Level: Moderator

Registered: 16-05-2002
Posts: 1681
icon 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
View Profile Send Email to User Show All Posts | Quote Reply
~Bean~
Level: VB Guru


Registered: 07-04-2003
Posts: 488
icon Re: Gray RGB

THX!

That's pretty much what I was looking for...

I needed to make a color scheme or two and also needed that gray color...it's quick and dirty-no error protection and not a masterpiece but it does what I need it to...it'll pull any system color and it will also convert RGB to Hex and vice-versa...



I was going to attach to this post but my attachment gets rejected...File Type not allowed...what gives with that?




____________________________
Eggheads unite! You have nothing to lose but your yolks.

19-02-2005 at 04:47 AM
View Profile Send Email to User Show All Posts Visit Homepage | Quote Reply
Goran
Level: Moderator

Registered: 16-05-2002
Posts: 1681
icon Re: Gray RGB

Are you set up now, or you need also to convert from hex to RGB?  

____________________________
If you find the answer helpful, please mark this topic as solved.

19-02-2005 at 11:59 AM
View Profile Send Email to User Show All Posts | Quote Reply
~Bean~
Level: VB Guru


Registered: 07-04-2003
Posts: 488
icon Re: Gray RGB

no...I'me good to go now!...THX!

____________________________
Eggheads unite! You have nothing to lose but your yolks.

19-02-2005 at 05:45 PM
View Profile Send Email to User Show All Posts Visit Homepage | Quote Reply
Dave Green
Level: Professor


Registered: 20-10-2005
Posts: 90
icon Re: Gray RGB

Hi All
If anyone's still following this thread then I've written an explanation (around 20th October 05) on this in the General Discussion forum - see Getting System Colour Constants

Regards
Dave

[Edited by Dave Green on 22-10-2005 at 09:27 PM GMT]

____________________________
While Breath.Count>0
       Live(gbRelax)
Wend

22-10-2005 at 08:24 PM
View Profile Send Email to User Show All Posts | Quote Reply
AndreaVB Forum : Multimedia : Gray RGB
Previous Topic (Midi file to binary file)Next Topic (playing any kind of video in VB!) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder