C# TextBox文本内容选中

   textBox1.Focus();

   textBox1.SelectionStart = 0;  //设置起始位置 

   textBox1.SelectionLength = 2;  //设置长度

   textBox1.ScrollToCaret();

  

posted @ 2021-01-07 19:52  沉浮。。。  阅读(1791)  评论(0编辑  收藏  举报