当应用程序在Designer模式下运行时,如何更改Devexpress WinForm应用程序的默认主题?
答案 0 :(得分:4)
这可以使用DefaultLookAndFeel组件完成。 How to: Customize the Look And Feel of All the Controls within an Application主题说明了如何在代码中执行此操作。
答案 1 :(得分:2)
来源: Allowing user selected Global Theme for winform app
您可以使用外观更改整个应用程序的主题。使用以下方法:
在主窗体的构造函数中调用:
DevExpress.Skins.SkinManager.EnableFormSkins();
这将使您的表单能够使用当前皮肤。同样重要的是,您的每个表单都来自XtraForm。
之后,您需要为应用程序设置全局外观对象:
//This set the style to use skin technology
DevExpress.LookAndFeel.UserLookAndFeel.Default.Style = DevExpress.LookAndFeel.LookAndFeelStyle.Skin;
//Here we specify the skin to use by its name
DevExpress.LookAndFeel.UserLookAndFeel.Default.SetSkinStyle("Black");
参考文献:
How do I change a DevExpress project's theme after creation?
How to: Customize the Look And Feel of All the Controls within an Application