Color of the toolbar and button background

  • Thread starter Thread starter ORC
  • Start date Start date
O

ORC

Does anyone know the RGB background color of a button or the ToolBar ?

I have tried to read the color by this:
MessageBox.Show(

button1.BackColor.R.ToString() + " " +

button1.BackColor.G.ToString() + " " +

button1.BackColor.B.ToString());



But it doesn't work (I guess it's because CF doesn't support backColor of
these controls)

Thanks

Ole
 
Ole,

your code woks fine and returns 192,192,192 for a button.

Do you have SP2 installed?
SP2 includes backcolor support ( not in the designer but handcoded )

Ruediger
 
Hi Rüdiger,

I get the value 255, 255, 255 so it's a wrong color. The color 192,192,192
is called "silver" and isn't the correct color either (maybe the color I'm
looking for is actually called face color) . How about the color of the
toolbar - do you have any idea of what that is ? I'm trying to make my own
toolbar and need to make it the same color as the standard Toolbar.

Thank you for your help!
Ole
 
Ole,

I got 255,255,255 under CF < SP2.

First I tried your Code under CE 4.2 . Result was 192,192,192.
Afterwards I tested on a PPC 2003 Device - the result is 217,204,192 for
toolbar and buttons. That's strange: buttons seems to appear in 'silver'
and tooolbar in a kind of white.

Ruediger
 
Hi Rüdiger,

You're right. I have now upgraded to SP2 and the colors RGB values shows up
corectly now - thanks for the advice. The system Menu color seems however to
have a bug - it has the RGB value 255;255;255 which is wrong - I think it is
a bug in Studio .NET 2003 - see my post "Color bug in CF or Studio .NET ?".

Ole
 
Back
Top