Search code examples
.netvb.netdevexpresslook-and-feel

How to change the default LookAndFeel for the entire application?


This page lists a way to change the default LookandFeel for a .net application using DevExpress 10.2. It's not working for me.

My code (in Main())

imports DevExpress.LookAndFeel

DevExpress.LookAndFeel.UserLookAndFeel.Default.SkinName = "Caramel"
DevExpress.LookAndFeel.UserLookAndFeel.Default.UseWindowsXPTheme = False
DevExpress.LookAndFeel.UserLookAndFeel.Default.LookAndFeelStyle.Office2003

My users hate this new grey theme and want Caramel back... suggestions?


Solution

  • Your code should work. But you have to make sure that all your forms are derived from DevExpress.XtraEditors.XtraForm (for a Winforms-Application). Otherwise the LookAndFeel will not be propagated to the controls on the forms. In general: if you place a devexpress control in a container that is not derived from a devexpress container the look-and-feel will not change.

    Edit: the original question & answer was for DevExpress v 10.x. Starting with DevExpress V 2011.2 you need to reference a "DevExpress.BonusSkins.vXX.Y"-library in your project and register the bonus skins via

    DevExpress.UserSkins.BonusSkins.Register();
    

    The bonus skin libraries are called e.g. "DevExpress.BonusSkins.v12.1.DLL" and can be found in the "\Bin\Framework"-Folder of your DevExpress-installation.

    Complete code would look like:

    DevExpress.UserSkins.BonusSkins.Register();
    DefaultLookAndFeel defaultLF = new DefaultLookAndFeel();
    defaultLF.LookAndFeel.UseDefaultLookAndFeel = true;