在C#中更改默认字体对话框 [英] Change default font dialog in c#

查看:169
本文介绍了在C#中更改默认字体对话框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

Can anyone tell me how can set default Font Name , Font Size , Font Color.. of FontDialog;

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

dlg.ShowDialog();方法应该显示我选择插入的 Microsoft San Serif字体名称。

The dlg.ShowDialog() ; method should show Font name that I choose insted of "microsoft san serif"

推荐答案

您只需要设置字体属性,然后调用 ShowDialog

You just need to set the Font property before calling ShowDialog.

例如:

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

这篇关于在C#中更改默认字体对话框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆