June 2003
Intermediate to advanced
800 pages
34h 20m
English
You want to use system-defined colors when drawing.
Use the properties of the System.Drawing.SystemColors class.
When mixing standard Windows interface elements with your own drawing code, you need to take special care that you follow the system color scheme. Otherwise, you might end up with illegible text—or just garishly ugly windows.
Retrieving system color information is easy. You can simply use the shared properties of the System.Drawing.SystemColors class. In addition, you can use the System.Drawing.KnownColors enumeration to retrieve a list of friendly (human-readable) color names and system color names.
Here’s an example that draws text on a form using the background and foreground colors of the form ...
Read now
Unlock full access