我正在测试一个有一些texbox的WPF应用程序。当屏幕大小不足以显示完整的文本框文本时,它会被“截断”并带有省略号:ABCDEDF
=> ABC ...
我想测试这种行为,但不能从任何文本属性中获取值ABC ...
,总是得到ABCDEF
,有什么建议吗?
答案 0 :(得分:0)
来自Microsoft参考:
/// <summary>
/// The TextTrimming property specifies the trimming behavior situation
/// in case of clipping some textual content caused by overflowing the line's box.
/// </summary>
public TextTrimming TextTrimming
{
get { return (TextTrimming)GetValue(TextTrimmingProperty); }
set { SetValue(TextTrimmingProperty, value); }
}
TextTrimming定义如何在WPF TextBlock中修剪文本。