从 Silverlight RichTextBox 获取行数?
有没有人有办法从 Silverlight RichTextBox
获取行数?我尝试过计算
标签,但这似乎不太准确。 RichTextBox 中的文本每次都会不同,因此我需要一种可靠的方法来计算用户完成输入时有多少行文本。
有谁知道有什么方法可以做到这一点?
Does anyone of a way to get a line count from a Silverlight RichTextBox
? I've tried counting the <Run>
tags but that doesn't seem to be very accurate. The text in the RichTextBox
will be different each time, so I need a good solid way to calculate how many lines of text are when the user is finished typing.
Does anyone know of a way to do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好吧,我也有这段涉及运行标签的代码(我没有编写它,我不记得它是从哪里获取的,所以我不会因此而获得任何荣誉)。和你的有什么不同吗?
Well I had this code involving the run tags too (I didn't write it and I can't remember where it was taken from so I won't take any credit for it). Is it different from yours?