1.根据文字换行
this.TextBox1.Multiline=true;
2.控件自适应高度
在这里插入代 private void TextBox1_TextChanged(object sender, EventArgs e)
{
int h = TextBox1.Height;
for (int i = 0; i < TextBox1.Lines.Length ; i++)
{
TextBox1.Height += h;
}
}码片