110,536
社区成员
发帖
与我相关
我的任务
分享
private void richTextBox1_TextChanged(object sender, EventArgs e)
{
string[] str = this.richTextBox1.Lines;
float textLenth = str[str.Length - 1].Length * this.richTextBox1.Font.Size;
if (textLenth > this.richTextBox1.Size.Width)
this.richTextBox1.Width = (int)textLenth;
}