A simple task is to go through all the checkboxes in this form and this taba and mark them as not selected. I found in my opinion the right solution:
foreach (Control c in this.Controls) { CheckBox cb = c as CheckBox; if (cb != null && cb.Checked) { cb.Checked = false; } }
But it does not work! And I do not understand why. I watched the debugger - cb = null. Why can this be? Which way to dig? ..
cb == Null
, then inс
is not aCheckBox
at all, look at what type it is - yapycoder