The adaptive control button text

Daily one case 2020-03-13 Day 5

1. Add the button 1 and the label, textbox control, and modify the values ​​of the corresponding text;

 

 2. Modify the TextChanged event textBox1 and enter the code;

button1.Text = textBox1.Text; // Text button assignment
button1.AutoSize = true; // button to automatically change the automatic size setting

3. examples completed, the final results are as follows:

 

 

Guess you like

Origin www.cnblogs.com/ljs7490/p/12484010.html