posts - 124,  comments - 29,  trackbacks - 0

 //设置textbox每行最多显示固定个字符
        public static void SetTextBoxColumn(TextBox textBox1, int charCount)
        {
            try
            {
                for (int i = 0; i < textBox1.Lines.Length; i++)
                {
                    if (textBox1.Lines[i].Length > charCount)
                    {
                        int firstCharIndex = textBox1.GetFirstCharIndexFromLine(i);
                        string str = textBox1.Lines[i];
                        textBox1.Text = textBox1.Text.Insert(firstCharIndex + charCount, "\r\n");

                    }
                }
            }
            catch { }
        }

posted on 2010-05-17 16:05 天书 阅读(1021) 评论(0)  编辑 收藏 引用

<2008年6月>
25262728293031
1234567
891011121314
15161718192021
22232425262728
293012345

常用链接

留言簿(5)

随笔档案

文章分类

文章档案

好友的Bolg

搜索

  •  

最新评论

阅读排行榜

评论排行榜