简体   繁体   English

如何获取TextBlock的TextTrimming的位置

[英]How can I get the location of a TextBlock's TextTrimming

If I have a long string of text in which the font size and family is adjustable, and it gets texttrimmed a few lines into the TextBlock's window, how do I get the spot or IndexOf or whatever of the point where the string is cut off? 如果我有一长串可调整字体大小和字体的文本,并且将其文本修剪到TextBlock的窗口中几行,那么我如何获得斑点或IndexOf或截断该字符串的任何点?

I guess one way to put this is, like an article that spans two pages, I would like to get the indexof the end of the first page so I can know the next word in the article to begin on the second page. 我想一种表达方式是,就像一篇跨越两页的文章一样,我想获得第一页末尾的索引,这样我就可以知道文章中的下一个单词要从第二页开始。

您可以通过迭代调用GetPositionFromCharIndex来搜索截止点。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM