skineditor-403001-skin-patches.md
Skin patches allow you to embed changes directly into standard DevExpress skins. Each skin can have an unlimited number of patches applied to it.
Enter the skin patch name and local storage folder where this patch should be stored, and click “Create Patch”.
Similarly to custom light skins, patches are initially empty. To modify a skin element, you should first “Activate” it.
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.
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 | Existing Item…” dialog to add your patch file to this folder. Set the “Copy to Output Directory” option for this file to “Copy Always”.
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);
DevExpress.Skins.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);
}
Imports DevExpress.LookAndFeel
Imports DevExpress.Skins
Imports System
Private Sub btnReset_Click(ByVal sender As Object, ByVal e As EventArgs)
SkinManager.Default.ResetSkin(SkinStyle.Basic)
End Sub