博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
如何修改全部DevExpress控件的字体
阅读量:7043 次
发布时间:2019-06-28

本文共 1181 字,大约阅读时间需要 3 分钟。

引用:https://www.devexpress.com/Support/Center/Question/Details/A2761

 

You can change the default font used by DevExpress WindowsForms controls with the following static properties:

 - Specifies the default font of controls (except menus and toolbars).

 - Specifies the default font used by menus and toolbars.
 - Specifies the default text font used when printing DevExpress controls.

 

可以通过修改以下静态属性:

DevExpress.XtraEditors.WindowsFormsSettings.DefaultFont - 指定控件的默认字体,除了菜单(menu)和工具栏(toolbar)

DevExpress.XtraEditors.WindowsFormsSettings.DefaultMenuFont - 指定菜单(menu)和工具栏(toolbar)的默认字体

DevExpress.XtraEditors.WindowsFormsSettings.DefaultPrintFont - 指定打印控件(printing)的默认文本字体

[STAThread]static void Main() {    DevExpress.XtraEditors.WindowsFormsSettings.DefaultFont = new Font("Courier New", 10);    Application.Run(new Form1());}

  

如果想改变某个控件的字体,需要通过设置AppearanceObject.Font属性(通常,外观属性都有名为“Appearance”的字样)

using DevExpress.Utils;using DevExpress.XtraGrid.Views.Grid;void SetGridFont(GridView view, Font font) {    foreach(AppearanceObject ap in view.Appearance)        ap.Font = font;}// USAGE:SetGridFont(gridView1, new Font("Courier New", 10));

 

转载于:https://www.cnblogs.com/lukali/p/5982066.html

你可能感兴趣的文章
接口自动化测试平台-接入持续集成jenkins
查看>>
day-2 Python基础数据类型
查看>>
day-8 模块
查看>>
大三下学期第九周总结
查看>>
SVN关键字
查看>>
java.lang.NoSuchMethodError 报500
查看>>
Cmd find命令 和 findstr 命令
查看>>
linux添加环境变量
查看>>
vmware下的linux没有网络问题解决思路
查看>>
小程序如何引入阿里巴巴矢量图
查看>>
小程序flex布局,justify-content属性的应用
查看>>
经典博文
查看>>
CentOS7安装和使用squid代理
查看>>
ADC电流采集
查看>>
logstash启动失败的问题追查
查看>>
基于容器制作镜像
查看>>
js刷新页面的方法
查看>>
Vue-入门
查看>>
delegate 和 block 的区别
查看>>
网格贴图合并
查看>>