实现效果:

知识运用:
按钮的AutoSize属性 //获取或设置一个值 以指示按钮是否基于其内容调整大小
public override bool AutoSize{get;set;}
实现代码:
private void button2_Click(object sender, EventArgs e)
{
this.button1.AutoSize = true;
this.button1.Text = textBox1.Text;
}
浙公网安备 33010602011771号