I am new to C# i have these many string values in my code as
string text1 = textbox1.text;
string text2 = textbox2.text;
string text3 = textbox3.text;
string text4 = textbox4.text;
and some bool values as well
bool chk1 = checkBox1.Checked;
bool chk2 = checkBox2.Checked;
bool chk3 = checkBox3.Checked;
also i have checkboxes types to be true
checkBox2.Checked = true;
checkBox3.Checked = true;
checkBox4.Checked = true;
checkBox5.Checked = true;
the checkbox part is basically at form load
Is there a way to write some neat code and reduce no. of lines?
Thanks
Use arrays: