给你个大概的写法:
using (FontDialog fd = new FontDialog())
{
DialogResult result = fd.ShowDialog();
if (result == System.Windows.Forms.DialogResult.OK)
{
txtBox.FontFamily = new FontFamily(fd.Font.FontFamily.Name);
txtBox.FontSize = fd.Font.Size;
if (fd.Font.Strikeout == true)
{
txtBox.TextDecorations.Add(TextDecorations.Strikethrough);
}
if(fd.Font.Underline==true)
{
txtBox.TextDecorations.Add(TextDecorations.Underline);
}
txtBox.FontWeight = fd.Font.Bold ? FontWeights.Bold : FontWeights.Normal;
txtBox.FontStyle = fd.Font.Italic ? FontStyles.Italic : FontStyles.Normal;
}
}