在Winform环境下DevExpress标题栏皮肤
第一步:引用DLL文件,安装DevExpress后在引用>程序集>扩展:
DevExpress.BonusSkins.v12.2.dll
DevExpress.Utils.v12.2.dll
DevExpress.Data.v12.2
DevExpress.Skins.SkinManager.EnableFormSkins();
DevExpress.UserSkins.BonusSkins.Register();
第三步:创建Form窗体
将public partial class Form1 : Form
改为public partial class Form1 : XtraForm
第四步:添加控件
1.添加defaultLookAndFeel控件,默认在DX.12.2:Components工具栏下。
2.添加comboBox控件。
3.comboBox添加选择事件
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
this.defaultLookAndFeel1.LookAndFeel.UseDefaultLookAndFeel = false;
this.defaultLookAndFeel1.LookAndFeel.UseWindowsXPTheme = false;
this.defaultLookAndFeel1.LookAndFeel.Style =DevExpress.LookAndFeel.LookAndFeelStyle.Skin;
string SkinName = this.comboBox1.SelectedItem.ToString();
this.defaultLookAndFeel1.LookAndFeel.SkinName = SkinName;
}