private bool IsFilterTypeChecked(string Name) { foreach (Control Ctrl in pnlFilterButtons.Controls) { CheckBox Chk = (CheckBox)Ctrl; if (Chk.Text == Name) return Chk.Checked; } return false; }