没什么技术含量,但如果不知道则实现起来很麻烦。

 

c#中textbox.lines只记录回车的数量,并不是真正的总行数,如何得到呢,请使用:

int 总行数 = this.textBox1.GetLineFromCharIndex(this.textBox1.Text.Length) + 1 ;

 

下面按钮,每点一下翻3行,只到最后,相当于翻页功能

     private void button1_Click(object sender, EventArgs e)
        {
            int m = this.textBox1.GetFirstCharIndexFromLine(3);
            if (m != -1)
            {
                this.textBox1.Text = this.textBox1.Text.Substring(m);
            }
        }

相关文章:

  • 2021-05-14
  • 2021-04-11
  • 2022-12-23
  • 2021-05-19
  • 2021-11-21
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-08-27
  • 2021-06-02
  • 2022-12-23
  • 2021-08-27
  • 2022-12-23
相关资源
相似解决方案