Respect for XP themes when developing the WinForms interface

How do you work with different XP themes when developing the WinForms interface? Do you avoid hard-coded color values ​​or just agree that your user interface will not look good on non-standard themes?

For example, I have a panel with a blue gradient that looks great against the standard background color of the control, but will encounter other custom themes. What is a good approach?

+6
user-interface winforms
source share
1 answer

Avoid hexadecimal colors and colors with names such as White or Green. Choosing a color for most objects should show you colors with names like ActiveWindow or ForegroundText. These are the colors you want to use. They are also available through code, and you want to select them so that the names have something to do with how they are used. For example, do not set “ForegroundText” as the background color just because you need a black background. If you have a gradient, use these colors to create the gradient. In addition, there is an event that you may need to change the topic.

This is if you decide to respect the topics. If you have a truly external interface, you can specify your own colors. In this case, never use the colors of the windows, because they will not be reliable, and you can be really ugly in something. This means that you will need to go and change all the default values ​​in the standard controls, but if you do this, you probably have your own controls.

In general, all that needs to be remembered is that all or nothing fired: either respect the themes, or always use colors defined based on elements of the Windows widget, or never use themes and never use these colors at all.

+10
source share

All Articles