我是 C# 新手,我的代码中有这么多字符串值
string text1 = textbox1.text;
string text2 = textbox2.text;
string text3 = textbox3.text;
string text4 = textbox4.text;
还有一些布尔值
bool chk1 = checkBox1.Checked;
bool chk2 = checkBox2.Checked;
bool chk3 = checkBox3.Checked;
我也有复选框类型为真
checkBox2.Checked = true;
checkBox3.Checked = true;
checkBox4.Checked = true;
checkBox5.Checked = true;
复选框部分基本上是在表单加载有没有办法编写一些整洁的代码并减少没有。行数?
谢谢