如何更改整个应用程序的默认LookAndFeel?
此页面列出了使用 DevExpress 10.2 更改 .net 应用程序的默认 LookandFeel 的方法。这对我不起作用。
我的代码(在 Main()
中)
imports DevExpress.LookAndFeel
DevExpress.LookAndFeel.UserLookAndFeel.Default.SkinName = "Caramel"
DevExpress.LookAndFeel.UserLookAndFeel.Default.UseWindowsXPTheme = False
DevExpress.LookAndFeel.UserLookAndFeel.Default.LookAndFeelStyle.Office2003
我的用户讨厌这个新的灰色主题并希望 Caramel 回来...有建议吗?
This page lists a way to change the default LookandFeel for a .net application using DevExpress 10.2. It's not working for me.
My code (in Main()
)
imports DevExpress.LookAndFeel
DevExpress.LookAndFeel.UserLookAndFeel.Default.SkinName = "Caramel"
DevExpress.LookAndFeel.UserLookAndFeel.Default.UseWindowsXPTheme = False
DevExpress.LookAndFeel.UserLookAndFeel.Default.LookAndFeelStyle.Office2003
My users hate this new grey theme and want Caramel back... suggestions?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
你的代码应该可以工作。但您必须确保所有表单均源自 DevExpress.XtraEditors.XtraForm(对于 Winforms 应用程序)。否则,LookAndFeel 将不会传播到窗体上的控件。
一般来说:如果将 devexpress 控件放置在不是派生自 devexpress 容器的容器中,则外观不会改变。
编辑:原始问题&答案是 DevExpress v 10.x。从 DevExpress V 2011.2 开始,您需要在项目中引用“DevExpress.BonusSkins.vXX.Y”库并通过注册奖励皮肤。
奖励皮肤库称为“DevExpress.BonusSkins.v12.1.DLL”,并且可以可以在 DevExpress 安装的“\Bin\Framework”文件夹中找到。
完整的代码如下所示:
Your code should work. But you have to make sure that all your forms are derived from DevExpress.XtraEditors.XtraForm (for a Winforms-Application). Otherwise the LookAndFeel will not be propagated to the controls on the forms.
In general: if you place a devexpress control in a container that is not derived from a devexpress container the look-and-feel will not change.
Edit: the original question & answer was for DevExpress v 10.x. Starting with DevExpress V 2011.2 you need to reference a "DevExpress.BonusSkins.vXX.Y"-library in your project and register the bonus skins via
The bonus skin libraries are called e.g. "DevExpress.BonusSkins.v12.1.DLL" and can be found in the "\Bin\Framework"-Folder of your DevExpress-installation.
Complete code would look like:
当您创建使用任何 Developer Express 组件的项目时,将对
DevExpress.Utils
库的引用添加到其中。该库包含所有组件通用的帮助器类,并且还提供了一些默认皮肤其他皮肤
在 DevExpress.BonusSkins 库中实现。
要注册 DevExpress.BonusSkins 库附带的皮肤,请调用
DevExpress.UserSkins.BonusSkins
的静态 Register 方法> 类。有关更多详细信息,请参阅此链接。
When you create a project that uses any Developer Express component, a reference to the
DevExpress.Utils
library is added to it. This library contains helper classes common to all components and also provides some default skinsOther skins
are implemented in the DevExpress.BonusSkins library
To register skins shipped with the DevExpress.BonusSkins library, call the static Register method of the
DevExpress.UserSkins.BonusSkins
class.See this link for more details.
以下代码应该适合您:
The following code should work for you:
在我读了很多之后,我确实喜欢这个并且运行得非常完美!
1 - 创建一个模块并编写以下代码:
2 - 显然,在每个表单(Form1.Designer.vb)中更改此行:
祝你好运!
After i read much, i did like this and run me perfect!
1 - Create a module and write this code:
2 - And OBVIOUSLY Change this line in each form (Form1.Designer.vb):
Good luck!
尝试将 LookAndFeelStyle 设置为“Skin”:
Try setting the LookAndFeelStyle to "Skin":