打开带有突出显示的特定字体的 FontDialog [英] Open FontDialog with a specific font highlighted

查看:19
本文介绍了打开带有突出显示的特定字体的 FontDialog的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我打开标准的保存文件对话框或打开文件对话框,我可以设置文件夹和文件类型的默认值.
有什么方法可以使用当前选择的字体调用字体对话框,它打开了,高度是我选择的字体之一?换句话说,如果出于某种原因我希望它以 Lucinda Calligraphy 作为突出显示的字体打开,那么它将作为当前选择打开.

If I open the standard save file dialog, or the open file dialog I can set defaults for the folder and file type.
Is there any way that the Font Dialog can be called with the currently selected font that it opens up with heighted being one of my choosing? In other words if for some reason I wanted it to open with Lucinda Calligraphy as the highlighted font then that is what it would open up with as its current selection.

推荐答案

Private Sub button1_Click(sender As Object, e As System.EventArgs)
      Dim fontDialog1 As FontDialog = New FontDialog;
      fontDialog1.Font = new Font("Lucida Calligraphy", 10.0F)

      If fontDialog1.ShowDialog() <> DialogResult.Cancel Then
          textBox1.Font = fontDialog1.Font
          textBox1.ForeColor = fontDialog1.Color
      End If
  End Sub 'button1_Click

这篇关于打开带有突出显示的特定字体的 FontDialog的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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