public bool fn_validator(int current_view = 0, int border = 0, Color? color = null, Panel _panel = null) { //looops through / iterates all items in form and checks for validation color.GetValueOrDefault(Color.Red); bool atleastone = false; foreach (Control a in _panel.Controls.Cast<Control>()) { if (check_control(a, Color.Red, 4)) { atleastone = true; } } if (atleastone) { return true; } return false; }