您当前的位置: 首页 > 

Jave.Lin

暂无认证

  • 3浏览

    0关注

    704博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

限制RichTextBox的行数方法

Jave.Lin 发布时间:2012-11-15 18:33:19 ,浏览量:3

主要代码:

            this.richTextBox_query_txt.AppendText("" + r.Next(100000, 999999999) + "\n");

            int maxLinds = 3;

            if (this.richTextBox_query_txt.Lines.Length > maxLinds)
            {
                int moreLines = this.richTextBox_query_txt.Lines.Length - maxLinds;
                string[] lines = this.richTextBox_query_txt.Lines;
                Array.Copy(lines, moreLines, lines, 0, maxLinds);
                Array.Resize(ref lines, maxLinds);
                this.richTextBox_query_txt.Lines = lines;
            }

关注
打赏
1664331872
查看更多评论
立即登录/注册

微信扫码登录

0.0396s