2015年5月22日 星期五

C# Textbox automatically scroll to the bottom

If you try to show the text on your textbox,we will account a problem.
The textbox vertical or horizontal length is not enough for us to use.
LIKE THIS PICRURE BELOW



















Solution:
  textBox1.ScrollBars = ScrollBars.Vertical; //scroll in vertical 
  textBox1.Text +=count+" : "+ read.GetInt32(0) + "Data"+"\r\n";
  textBox1.SelectionStart = textBox1.Text.Length;
  textBox1.ScrollToCaret();
  textBox1.Refresh();






沒有留言:

張貼留言