Skip to main content
All docs
V21.2

Skin Patches

  • 2 minutes to read

Skin patches allow you to embed changes directly into standard DevExpress skins. Each skin can have an unlimited number of patches applied to it.

Create a Skin Patch

  1. Start the Skin Editor and switch to the “New Skin Patch” tab.

create new skin patch

  1. Enter the skin patch name and local storage folder where this patch should be stored, and click “Create Patch”.

  2. Similarly to custom light skins, patches are initially empty. To modify a skin element, you should first “Activate” it.

activate skin element

  1. Edit active elements and press “Save”. You patch is now saved as a SkinName.skinpatch file.

Note

When you press “Save”, the project is saved in the SkinName folder (the name matches the project’s name). The Skin Editor creates this folder if it does not exist.

Apply and Undo Skin Patches

To load and apply a skin patch, call the SkinManager.Default.RegisterSkinPatch method on application startup. This method has three overloads that allow you to load a .skinpatch file from local storage, stream, or assembly.

For instance, create a new folder in the Visual Studio Solution Explorer panel and use the “Add | New Item…” dialog to add your patch file to this folder. Set the “Copy to Output Directory” option for this file to “Copy Always”.

add skin patch to project

Now you can apply it as follows:

namespace SkinPatch {
    static class Program {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main() {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            SkinManager.Default.RegisterSkinPatch(Application.StartupPath +
                "\\patches\\Basic-FormBorderThickness.skinpatch");
            Application.Run(new Form1());
        }
    }
}

To undo all patches applied to a DevExpress skin and revert it back to its default state, call the SkinManager.Default.ResetSkin method.

using DevExpress.LookAndFeel;
using DevExpress.Skins;
using System;

void btnReset_Click(object sender, EventArgs e) {
    SkinManager.Default.ResetSkin(SkinStyle.Basic);
}