SystemBrushes,SystemColors,SystemFonts,SystemPens,SystemIcons

  • Thread starter Thread starter Tony Johansson
  • Start date Start date
T

Tony Johansson

Hi!

I just wonder when is it advisable to use these classes that are prefixed
with System
SystemBrushes,SystemColors,SystemFonts,SystemPens,SystemIcon
instead of these classes that I'm more used to
Brushes,Colors,Fonts,Pens,Icons ?

//Tony
 
I just wonder when is it advisable to use these classes that are prefixed
with System
SystemBrushes,SystemColors,SystemFonts,SystemPens,SystemIcon
instead of these classes that I'm more used to
Brushes,Colors,Fonts,Pens,Icons ?

Those classes simply contain "pre-built" objects are just instances of the
non-System-prefixed classes. So SystemBrushes just contains a bunch of Brush
(SolidBrush) objects. What's handy about them is that you don't have to
worry about disposing of these objects, since they're global. (Well, you
never have to worry about disposing of a Color, but you know what I mean.)

Be aware, though, that the colors of SystemBrushes are totally depended on
the current user's color scheme, so SystemBrushes.Control might be one shade
of gray on your machine, another on a machine using a different theme, and
perhaps white or silver on another machine. That is the benefit of using
these Systemxxx classes: you can be assured of getting objects that conform
to the user's theme, but it also means you can't rely on them to produce a
specific color. If you need that, just use the "regular" objects and specify
exactly what you need.
 
Jeff Johnson said:
Those classes simply contain "pre-built" objects are just instances of the
non-System-prefixed classes. So SystemBrushes just contains a bunch of
Brush (SolidBrush) objects. What's handy about them is that you don't have
to worry about disposing of these objects, since they're global. (Well,
you never have to worry about disposing of a Color, but you know what I
mean.)

Be aware, though, that the colors of SystemBrushes are totally depended on
the current user's color scheme, so SystemBrushes.Control might be one
shade of gray on your machine, another on a machine using a different
theme, and perhaps white or silver on another machine. That is the benefit
of using these Systemxxx classes: you can be assured of getting objects
that conform to the user's theme, but it also means you can't rely on them
to produce a specific color. If you need that, just use the "regular"
objects and specify exactly what you need.

I mean SystemBrushes.Desktop takes the same color that I have chosen for my
desktop. So if I change the color
for the Desktop then SystemBrushes.Desktop will use the same Color

But how do I change on my computer so SystemBrushes.Control will also be
changed automatically ?

//Tony
 
I mean SystemBrushes.Desktop takes the same color that I have chosen for
my
desktop. So if I change the color
for the Desktop then SystemBrushes.Desktop will use the same Color

But how do I change on my computer so SystemBrushes.Control will also be
changed automatically ?

If I understand what you're asking, you right-click the Desktop and choose
Properties (or go to Control Panel and run the Display applet) and then
(assuming Windows XP) you choose the Appearance tab and click the Advanced
button. Then you can change the colors for various elements in the Windows
GUI. You won't see one labeled "control"; I believe it's the "3D objects"
option.

If I didn't understand the question, please re-phrase.
 
I mean SystemBrushes.Desktop takes the same color that I have chosen for my
desktop. So if I change the color
for the Desktop then SystemBrushes.Desktop will use the same Color

But how do I change on my computer so SystemBrushes.Control will also be
changed automatically ?

//Tony


Adding to Jeff's answer, if Vista, you need to choose "Window Color and
Appearance". At the bottom of this screen is an option to "Open classic
appearance properties for more color options". Then follow Jeff's
directions for XP.
 
Back
Top