这个怎么运作/strong>
这是皮肤补丁用例的一个很好的示例:在矢量Office 2019皮肤中停靠面板标题。
如果您发现面板标题字体太大,您可以添加 BarAndDockingController 并在”Docking” 部分手动设置字体。但这样做意味着无论激活皮肤如何,您的硬编码面板字体都将处于激活状态。
补丁保存为单个 .skinpatch 文件,保存后通过SkinManager.Default.RegisterSkinPatch 方法将其从本地存储、流或程序集导入到 Visual Studio 项目中。
namespace MyApp{static class Program {/// <summary>/// The main entry point for the application./// </summary>[STAThread]static void Main() {Application.EnableVisualStyles();Application.SetCompatibleTextRenderingDefault(false);SkinManager.Default.RegisterSkinPatch(Application.StartupPath +"\patches\O2019C-Fonts.skinpatch");//uncomment the following line to undo the skin patch//SkinManager.Default.ResetSkin(SkinStyle.Office2019Colorful);Application.Run(new MainForm());}}}
下图展示了标准的 “Office 2019 Colorful” 皮肤,其中包含一个补丁,可将文本大小增量从 6 减小到 2。
您可以更进一步并更改补丁中的更多元素,例如修改”Docking > Dock Panels > Caption Buttons”元素来减少按钮填充和大小,这将缩小面板标题来更好地适应您的新标题字体。
DevExpress WinForm | 下载试用
DevExpress WinForm拥有180+组件和UI库,能为Windows Forms平台创建具有影响力的业务解决方案。DevExpress WinForms能完美构建流畅、美观且易于使用的应用程序,无论是Office风格的界面,还是分析处理大批量的业务数据,它都能轻松胜任!
DevExpress技术交流群6:600715373 欢迎一起进群讨论

标签:
声明:本站部分文章及图片源自用户投稿,如本站任何资料有侵权请您尽早请联系jinwei@zod.com.cn进行处理,非常感谢!