c# - 在 C# 中更改默认字体对话框

标签 c# c#-4.0

谁能告诉我如何设置 FontDialog 的默认字体名称、字体大小、字体颜色……;

 FontDialog dlg = new FontDialog();
            dlg.ShowColor = true;
  if (dlg.ShowDialog() != DialogResult.OK) return;

dlg.ShowDialog();方法应该显示我选择的“microsoft san serif”字体名称

最佳答案

您只需在调用 ShowDialog 之前设置 Font 属性。

例如:

dlg.Font = new Font("Consolas", 10);
//or
dlg.Font = myCurrentlySelectedFont;

关于c# - 在 C# 中更改默认字体对话框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9498924/

相关文章:

web-services - Web 服务解析器错误消息 : Could not create type 'xxx'

java - 无论如何,要使用多次尝试和一次捕获?

c# - Visual Studio IIS 项目 HttpContext.Current.User.Identity.Current 为空

c# - 立即更新 toolStripStatusLabel

c# - 我如何对这个自定义命令行开关进行单元测试

c# - 事件顺序背后的 SqlDataSource 代码

c# - 设置 ASP :ContentPlaceHolder Content programmatically

C# SQlite - 使用 Query 计算字符串重复的次数(并发症)

c# - 按日期排序打印仅在LINQ中最新的20条记录

sql-server-2008 - 有没有办法从 C# 代码检查池中的连接?