0

我想在RichTextBox.SelectionFont不更改样式的情况下设置 FontFamily,因为我的字体不支持粗体和常规样式。

rtb.SelectionFont = New Font(New FontFamily(nicknamefonttype), nicknamefontsize, 0, GraphicsUnit.Point)

字体不支持粗体和常规字体是错误的。

4

1 回答 1

0

I am using this in my WPF application to apply a System.Drawing.FontFamily to my selected text:

rtb.Selection.ApplyPropertyValue(FontFamilyProperty, ((System.Drawing.FontFamily)rbngFonts.SelectedItem).Name);

The rbngFonts is a RibbonGallery, so I suspect you need to adapt it to your application.

于 2013-03-05T12:15:09.250 回答