Bonus and Custom Skin Registration

  • 2 minutes to read

Add a skin library to your project and call the skin registration code at the application's startup.

Register DevExpress.BonusSkins Library

You can register the BonusSkins library at design time via the Project Settings Page. If your main form is inhereted from the XtraForm class or its descendant, the project settings and the BonusSkins library registration code are applied automatically on the form's creation. See the Project Settings Page topic for additional information.

You can also register the BonusSkins library in code with the DevExpress.UserSkins.BonusSkins.Register method, by calling it at the application startup.


[STAThread]
static void Main() {
    // Skin registration.
    DevExpress.UserSkins.BonusSkins.Register();
    Application.Run(new Form1());
}

Register Custom Skins

For custom skins, you can obtain the skin registration code via the WinForms Skin Editor. See Export and Apply Custom Skins for more information.

The following example shows the registration code for a sample SkinProject1 library.


[STAThread]
static void Main() {
    //If your custom skin is derived from a template skin that resides in the BonusSkins library, ensure that you register the template skin first using the BonusSkins.Register method.
    //DevExpress.UserSkins.BonusSkins.Register()

    Assembly asm = typeof(DevExpress.UserSkins.SkinProject1).Assembly; 
    DevExpress.Skins.SkinManager.Default.RegisterAssembly(asm); 
    Application.Run(new Form1());
}
NOTE

If a custom skin's template resides in the BonusSkins library, ensure that you register the template skin first, using the BonusSkins.Register method, as demonstrated above.

Register Custom Skins for Use in Splash Screens and Wait Forms

Splash screens and wait forms created with the SplashScreenManager component run in a separate thread. Information on custom skins registered in the main thread is not available in the splash screen thread until you call the SplashScreenManager.RegisterUserSkins method.


SplashScreenManager.RegisterUserSkins(typeof(DevExpress.UserSkins.SkinProject1).Assembly);
splashScreenManager1.ShowWaitForm();
NOTE

If a custom skin is derived from one of the template skins located in the BonusSkins library, register the BonusSkins library in the main thread before you call the SplashScreenManager.RegisterUserSkins method.

See Also