首先让所有窗体继续一个基类窗体
新建一个基类窗体,如SkinForm
去掉构造函数,加上一个皮肤对象
public partial class SkinForm: XtraForm
{
public static DevExpress.LookAndFeel.DefaultLookAndFeel defaultLookAndFeel = new DevExpress.LookAndFeel.DefaultLookAndFeel();
}
在需要换肤的窗体上继承SkinForm
得到所有皮肤名字可用以下遍历
foreach (DevExpress.Skins.SkinContainer skin in DevExpress.Skins.SkinManager.Default.Skins)
{
comboBoxEdit1.Properties.Items.Add(skin.SkinName); //此处例子为combobox接收,可灵活改用其它的
}