I may be wrong but I don't think that it's easily possible to get the color
to be available across GUI element Property Sheets . You can define a color
using the "Custom" tab of a specific GUI elements' XXXcolor property but
that custom color is only for that element and that XXXcolor property so in
my experience you won't see it in the Custom tab of any other GUI elements
or even other XXXcolor properties of the same element. For example, setting
a custom BackColor property using the property page won't put that custom
color in the ForeColor property's color picker . To see this, select the
"Custom" tab in any color property such as "BackColor" and right click on
one of the empty squares at the bottom of the picker, this will pop up a
color designer where you can type in the rbg values. Now look at the same
elements's Forecolor Custom tab and you see that the color is not there.
However, it's easily done with a bit of code.
Create a new winform project. Add two buttons.
In the button1 click type:
Dim c As New Color
Me.BackColor = c.FromArgb(34, 45, 56)
Run the program and click the button.
Now, add the following to the declaration section (module level private var)
Private m_MySpecialColor As Color = Color.FromArgb(90, 100, 200)
And in the button2 click event type:
Me.BackColor = m_MySpecialColor
Run the program and press button 2.
You can use this color in your labels and strings of any control by setting
each controls' Forecolor property in code (perhaps in an formInit function
called by the form_load). Or, if you are defining Font objects explicity
you can use the color.FromArgb(x,y,z) right in the Font constructor (if the
color object is set in an accessable variable as shown in the second example
above, then you just reference that Color in the Font constructor).
Note: I used to work for an artist who took his colors VERY seriously and I
remember sitting with him and getting a color to be exactly as he wanted on
one machine. He was happy. Then he ran the app on another machine and it
was off... you can only get so close when it comes right down to it because
every video card and monitor will make your color look slightly different.
Robert Smith
Kirkland, WA
www.smithvoice.com