<TextBlock x:Name="txtTest" Grid.Column="" FontSize="9pt" Margin="0 2 0 0 " VerticalAlignment="Center" Foreground="#b9b9b9"
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
ScrollViewer.VerticalScrollBarVisibility="Disabled"
TextTrimming="CharacterEllipsis"
ToolTip="{Binding Text,ElementName=txtTest}"
Text="超长文本" />

TextTrimming="CharacterEllipsis"这个属性,会自动截断文本溢出部分(前提是TextBlock宽度不是auto)

05-14 17:03