是否可以在 WPF 中修剪容器底部的环绕文本?
我想在空间不足时修剪容器底部的 TextBlock 的内容。下图显示了我想要实现的目标。
左侧单元格包含在行尾换行的文本,但在行尾被裁剪最后一行。右侧单元格(我手动编辑的)显示了我想要通过修剪最后一行的文本来实现的效果。
在 WPF 中是否有一种(简单)方法可以实现此目的?
I would like to trim the contents of a TextBlock at the bottom of the container when it runs out of space. The image below shows what I am trying to achieve.
The left cell contains text that is being wrapped at the end of the line, but is being cropped on the final line. The right cell (which I edited by hand) shows the effect I want to achieve by trimming the text on the last line.
Is there an (easy) way to achieve this in WPF?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您是否尝试过 TextTrimming 属性?
Did you try the TextTrimming property?