标签:ati 需要 图片 https hid trim view strong character
原文:WPF中使用TextBlock显示长字符串的处理方法在WPF中,有时候要显示长字符串,需要用到换行或者截短的情况,方法如下:
<Grid>
<TextBlock Foreground="Red">
This is a sample for LineBreak:<LineBreak/>
This is line 1;<LineBreak/>
This is line 2.
</TextBlock>
<TextBlock Foreground="Green" TextWrapping="Wrap" Width="200">
This is a TextBlock control with automatically wrapped text by using TextWrapping property.
</TextBlock>
</Grid>
<Grid>
<TextBlock Foreground="Black" TextTrimming="None" TextWrapping="NoWrap" Width="200">
This is a TextBlock control with automatic trimming.
</TextBlock>
<TextBlock Foreground="Red" TextTrimming="CharacterEllipsis" TextWrapping="NoWrap" Width="200" Margin="0,20">
This is a TextBlock control with automatic trimming.
</TextBlock>
<TextBlock Foreground="Blue" TextTrimming="WordEllipsis" TextWrapping="NoWrap" Width="200" Margin="0,40">
This is a TextBlock control with automatic trimming.
</TextBlock>
</Grid>
达叔傻乐(darwin.zuo@163.com)
标签:ati 需要 图片 https hid trim view strong character
原文地址:https://www.cnblogs.com/lonelyxmas/p/12114628.html