I need simple logic iteration but many item…
this is my code
byte[] nc1 = new byte[40];
nc1 = ChekSt(36, "192.168.2.55", 38, 40);
//I need to iterate 40 times so my 40 checkbox can be updated
switch (nc1[0])
{
case 1: checkBox1.Checked = false; break;
case 2: checkBox1.Checked = true; checkBox1.CheckState = CheckState.Indeterminate; break;
case 3: checkBox1.Checked = true; checkBox1.CheckState = CheckState.Checked; break;
}
i have checkBox1, checkBox2, checkBox3… to checkBox40
i need someting like checkBox(i).checked = true;
so don’t have to write my code 40 times
anyone have idea…?
try with this code