如何不断滚动到多行文本框中的文本末尾? [英] How to constantly scroll to the end of text in multiline text box?

查看:17
本文介绍了如何不断滚动到多行文本框中的文本末尾?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用计时器用文本更新我的文本框.每次计时器滴答作响时,我都会被重定向到多行文本框中键入的文本的开头.

I'm updating my text box with text using a timer. Each time timer ticks I'm being redirected to the beginning to the text typed in my multiline text box.

如何做到这一点?

推荐答案

我想说的是,当您刷新时,您可以将选择光标移动到末尾,然后使用 ScrollToCaret 滚动文本框直到它可见.

I'd say that when you refresh, you could move the selection cursor to the end, then scroll the textbox 'til it's visible using ScrollToCaret.

就像

 yourtextbox.SelectionStart = yourtextbox.Text.Length
 yourtextbox.ScrollToCaret()

这篇关于如何不断滚动到多行文本框中的文本末尾?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆