//設置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 { }
}