Color bug in CF or Studio .NET ?

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

ORC

Setting the BackColor of a panel to System -> Menu makes the color of the
panel show gray in the Studio .NET design window exactly as expected, but
when running the application on the Pocket PC it is White ?!? The Menu color
of the Pocket PC should be Gray - is there a workaround for this ?

Thanks
Ole
 
ORC said:
Setting the BackColor of a panel to System -> Menu makes the color of the
panel show gray in the Studio .NET design window exactly as expected, but
when running the application on the Pocket PC it is White ?!? The Menu color
of the Pocket PC should be Gray - is there a workaround for this ?

Which version of the CF are you using? I believe there may have been
problems in this area before one of the service packs.
 
Hi Jon,

I'm using CF with SP2.

Ole

Jon Skeet said:
Which version of the CF are you using? I believe there may have been
problems in this area before one of the service packs.
 
What happens if you explicitly set it to gray rather than using the system
colors?

BackColor support was added in .NETCF SP2 for a number of controls, however
I'm not sure if that includes Panel which by default inherits it's color
from form on which it is placed.

What happens if you set the color assignment in code after the
InitializeComponent method has run?

Peter

--
Peter Foot
Windows Embedded MVP
www.inthehand.com | www.opennetcf.org

Do have an opinion on the effectiveness of Microsoft Windows Mobile and
Embedded newsgroups? Let us know!
https://www.windowsembeddedeval.com/community/newsgroups

ORC said:
Hi Jon,

I'm using CF with SP2.

Ole
 
Yes it is possible to set the backcolor of the panal control (even in the
older versions) doing this:
panel11.BackColor = SystemColors.Red;

Will show a red colored panel on the pocket PC - works great (also with
other colors).
But:
panel11.BackColor = SystemColors.Menu;
Shows a white panel !?!

Following code:
MessageBox.Show(
SystemColors.Menu.R.ToString() + "; " +
SystemColors.Menu.G.ToString() + "; " +
SystemColors.Menu.B.ToString());

Gives the result 255; 255; 255 - but the menu color should actually be
something like 217; 204; 192 - any clue?

Thanks
Ole

Peter Foot said:
What happens if you explicitly set it to gray rather than using the system
colors?

BackColor support was added in .NETCF SP2 for a number of controls, however
I'm not sure if that includes Panel which by default inherits it's color
from form on which it is placed.

What happens if you set the color assignment in code after the
InitializeComponent method has run?

Peter

--
Peter Foot
Windows Embedded MVP
www.inthehand.com | www.opennetcf.org

Do have an opinion on the effectiveness of Microsoft Windows Mobile and
Embedded newsgroups? Let us know!
https://www.windowsembeddedeval.com/community/newsgroups
 
Correction:
panel11.BackColor = SystemColors.Red;
Should have been:
panel11.BackColor = Color.Red;

sorry.
 
Looking at the designer SystemColor.Menu is displaying white. Try using
SystemColor.Control instead, on PocketPC this should be the same as the
menubar and button backgrounds. Popup menus themselves have a white
background by default. This is a slight difference from the traditional
windows shell where the menubar and drop-down menus are in the same color.

Peter

--
Peter Foot
Windows Embedded MVP
www.inthehand.com | www.opennetcf.org

Do have an opinion on the effectiveness of Microsoft Windows Mobile and
Embedded newsgroups? Let us know!
https://www.windowsembeddedeval.com/community/newsgroups
 
You're right - It's not the toolbar system color as I thouht - thanks. I'll
use the Control color instead.

Ole
 
Back
Top