<Window x:Class="WpfApp412.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:local="clr-namespace:WpfApp412" mc:Ignorable="d" WindowState="Maximized" Title="MainWindow" Height="450" Width="800"> <Window.Resources> <Style TargetType="{x:Type TextBlock}"> <Setter Property="FontSize" Value="100"/> </Style> </Window.Resources> <StackPanel> <TextBlock> <Run FontStyle="Italic" FontFamily="Georgia" Foreground="Red"> Rich </Run> </TextBlock> <TextBlock> <Run FontSize="30" FontFamily="Comic Sans MS" Foreground="Blue">Text</Run> </TextBlock> <TextBlock> <Run FontFamily="Arial Black" Foreground="Orange" FontSize="100">in</Run> </TextBlock> <TextBlock> <Run FontFamily="Courier New" FontWeight="Bold" Foreground="Green"> a</Run> </TextBlock> <TextBlock> <Run FontFamily="Verdana" TextDecorations="Underline">TextBlock</Run> </TextBlock> </StackPanel> </Window>
标签:Run,TextBlock,Textblock,WPF,TextDecorations,glyphFontSize From: https://www.cnblogs.com/Fred1987/p/18430672