http://stackoverflow.com/questions/637636/using-a-system-drawing-font-with-a-wpf-label
http://www.vistax64.com/avalon/88239-how-do-you-set-labels-font-underline-strikethrough.html
Set color:
Foreground="Red"
Set other things:
System.Drawing.Font font = FontFromLegacyCode();
System.Windows.Controls.Label label = new System.Windows.Controls.Label();
label.FontFamily = new System.Windows.Media.FontFamily( font.Name );
label.FontWeight = font.Bold ? System.Windows.FontWeights.Bold : System.Windows.FontWeights.Regular;
label.FontStyle = font.Italic ? System.Windows.FontStyles.Italic : System.Windows.FontStyles.Normal;
label.FontSize = font.Size;
<TextBlock Name="textBlock" TextDecorations="Underline, Strikethrough" />
<Label Name="label">
<TextBlock Name="textBlock" TextDecorations="Underline, Strikethrough" />
</Label>
本文介绍了如何在WPF中为Label设置字体样式,包括颜色、加粗、斜体及大小等,并展示了如何实现下划线和删除线效果。此外,还提供了一种使Label中的文本字号可调整的方法。
6932

被折叠的 条评论
为什么被折叠?



