概述:本文主要介绍如何更换DevExpress控件皮肤。
1. 在项目中添加引用 DevExpress.BonusSkins和 DevExpress.OfficeSkins (这两个引用中有大量的皮肤,默认的只有几个) 2.在启动Form的 Designer文件中添加main函数
[size=1em][size=1em]1
[size=1em]2
[size=1em]3
[size=1em]4
[size=1em]5
[size=1em]6
[size=1em]7
[size=1em]8
| [size=1em][size=1em]Shared Sub main()
[size=1em]'注册皮肤
[size=1em]DevExpress.UserSkins.OfficeSkins.Register()
[size=1em]DevExpress.UserSkins.BonusSkins.Register()
[size=1em]DevExpress.Skins.SkinManager.EnableFormSkins()
[size=1em]Application.Run(New XtraForm1())'启动窗口
[size=1em]End Sub
|
3.将项目的启动项修改为sub main(), 若无此项,将下面的"启动应用程序框架"的勾去掉 4.在启动窗口添加控件DefaultLookAndFeel, 5.启动时在load事件中 添加
[size=1em] | [size=1em][size=1em]Me.DefaultLookAndFeel1.LookAndFeel.SkinName = "Office 2007 Blue" '皮肤名,可用其他
|
至此,实现换肤功能. 如果要实现启动后更换皮肤, 可以把所有可用的皮肤名放到ComboBoxEdit1中即可. 附: 默认的皮肤名:Caramel,Money Twins,Lilian,The Asphalt World,iMaginary,Black,Blue BonusSkins的皮肤名: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 Style Office的皮肤名:Office 2007 Blue,Office 2007 Black,Office 2007 Silver,Office 2007 Green,Office 2007 Pink,Office 2010 Blue,Office 2010 Black,Office 2010 Silver 得到皮肤名的代码
[size=1em][size=1em]1
[size=1em]2
[size=1em]3
[size=1em]4
[size=1em]5
[size=1em]6
| [size=1em][size=1em]<pre class="vb" name="code">Dim str As String = ""
[size=1em]For Each skinName As DevExpress.Skins.SkinContainer In DevExpress.Skins.SkinManager.Default.Skins
[size=1em]str = str & skinName.SkinName & ","
[size=1em]Next</pre>
[size=1em]<pre></pre>
[size=1em]<pre></pre>
|
|