C#中实现文本框的滚动条自动滚到最底端

    1、配置textBox的Multiline属性为true;

2、配置textBox的ScrollBars属性为Vertical,实现纵向滚动条;

3、然后如下语句实现自己滚动:

       private void textBox3_TextChanged_1(object sender, EventArgs e)

        {

            textBox3.SelectionStart = textBox3.Text.Length;

            textBox3.ScrollToCaret(); 

        }
 

猜你喜欢

转载自blog.csdn.net/zgscwxd/article/details/86572030