KB Article A2753
Visible to All Users

How to convert a standard color to a color which corresponds to the current skin

Description:
Is there a way to get colors from the current skin so that they can be applied to standard controls?

Answer:
You can obtain the color which corresponds to the system color, e.g. SystemColors.Control or SystemColors.Highlight, in the current skin. Please use the following code.

C#
using DevExpress.Skins; //... Skin currentSkin = CommonSkins.GetSkin(DevExpress.LookAndFeel.UserLookAndFeel.Default); Color c = currentSkin.TranslateColor(SystemColors.Control);
Visual Basic
Imports DevExpress.Skins '... Dim currentSkin As DevExpress.Skins.Skin = CommonSkins.GetSkin(DevExpress.LookAndFeel.UserLookAndFeel.Default) Dim c As Color = currentSkin.TranslateColor(SystemColors.Control)

See Also:
How to obtain the color of a particular control's element when skins are used
How to get skin images at runtime

Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.