Skip to main content

How to: Customize Look And Feel of Specific Control(s)

  • 2 minutes to read

DevExpress controls are rendered using global look-and-feel settings, which are exposed by the Default LookAndFeel object. This allows you to apply the same paint scheme to all forms in your WinForms application.

Use a control’s LookAndFeel property to override default look-and-feel settings:

  1. Set the control’s LookAndFeel.UseDefaultLookAndFeel property to false to ignore default (global) settings.
  2. Customize the control’s LookAndFeel settings as needed.

    Tip

    The BaseEdit descendants expose the look-and-feel settings with the RepositoryItem.LookAndFeel property (it is available from editor.Properties.LookAndFeel for standalone editors). Other DevExpress controls allow you to access these settings with the control.LookAndFeel property.

    Important

    Limitations of SVG Skins:

    • Do not change the skin palette for specific controls.
    • Do not apply skins from the same ‘skin family’ to specific controls. For example, you should not apply the “Office 2019 Black” skin to specific controls if the default skin is “Office 2019 Colorful”.

The following example applies the “Office 2019 Black” skin to the ‘Cancel’ button (ButtonEdit):

CD_LookAndFeel_Example_ButtonEdit_Skin

using DevExpress.LookAndFeel;

namespace DXApplication {
    public partial class Form1 : DevExpress.XtraEditors.XtraForm {
        public Form1() {
            InitializeComponent();
            /* Specifies the default skin (the 'Basic' skin).
               The default skin is applied to all UI controls displayed on the Form.*/
            UserLookAndFeel.Default.SetSkinStyle(SkinStyle.Basic);

            // Disables the default look-and-feel settings for the 'Cancel' button.
            buttonCancel.LookAndFeel.UseDefaultLookAndFeel = false;
            // Specifies the 'Office 2019 Black' skin for the 'Cancel' button.
            buttonCancel.LookAndFeel.SkinName = SkinStyle.Office2019Black;
        }
    }
}

You can also use DX Skin Colors to visually highlight specific DevExpress controls (for example, buttons):

Apply Skin Colors to WinFOrms Simple Buttons, DevExpress

using DevExpress.LookAndFeel;

namespace DXApplication22 {
    public partial class Form1 : DevExpress.XtraEditors.XtraForm {
        public Form1() {
            InitializeComponent();
            UserLookAndFeel.Default.SetSkinStyle(SkinStyle.Basic);

            buttonCancel.Appearance.BackColor = DXSkinColors.FillColors.Danger;
            buttonSave.Appearance.BackColor = DXSkinColors.FillColors.Success;
        }
    }
}
See Also