zhouxuxuxiu 发表于 2015-9-24 10:51:07

如何更换DevExpress控件皮肤

概述:本文主要介绍如何更换DevExpress控件皮肤。

1. 在项目中添加引用 DevExpress.BonusSkins和 DevExpress.OfficeSkins (这两个引用中有大量的皮肤,默认的只有几个)2.在启动Form的 Designer文件中添加main函数

1
2
3
4
5
6
7
8
Shared Sub main()
'注册皮肤
DevExpress.UserSkins.OfficeSkins.Register()
DevExpress.UserSkins.BonusSkins.Register()
DevExpress.Skins.SkinManager.EnableFormSkins()

Application.Run(New XtraForm1())'启动窗口
End Sub




3.将项目的启动项修改为sub main(), 若无此项,将下面的"启动应用程序框架"的勾去掉4.在启动窗口添加控件DefaultLookAndFeel,5.启动时在load事件中 添加

1
Me.DefaultLookAndFeel1.LookAndFeel.SkinName = "Office 2007 Blue" '皮肤名,可用其他




至此,实现换肤功能. 如果要实现启动后更换皮肤, 可以把所有可用的皮肤名放到ComboBoxEdit1中即可.附:默认的皮肤名:Caramel,Money Twins,Lilian,The Asphalt World,iMaginary,Black,BlueBonusSkins的皮肤名:Coffee,Liquid Sky,London Liquid Sky,Glass Oceans,Stardust,Xmas 2008 Blue,Valentine,McSkin,Summer 2008,Pumpkin,Dark Side,Springtime,Darkroom,Foggy,High Contrast,Seven,Seven Classic,Sharp,Sharp Plus,DevExpress StyleOffice的皮肤名:Office 2007 Blue,Office 2007 Black,Office 2007 Silver,Office 2007 Green,Office 2007 Pink,Office 2010 Blue,Office 2010 Black,Office 2010 Silver得到皮肤名的代码

1
2
3
4
5
6
<pre class="vb" name="code">Dim str As String = ""
For Each skinName As DevExpress.Skins.SkinContainer In DevExpress.Skins.SkinManager.Default.Skins
str = str & skinName.SkinName & ","
Next</pre>
<pre></pre>
<pre></pre>






xiuxiupz 发表于 2015-9-24 11:26:04

页: [1]
查看完整版本: 如何更换DevExpress控件皮肤