//設(shè)置textbox每行最多顯示固定個(gè)字符
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
天書 閱讀(1022)
評(píng)論(0) 編輯 收藏 引用