I would like to filter the collection elements before I loop on each.
When I try this:
foreach (CheckBox checkbox in this.Controls()
.Where(c => c.GetType() == typeof (CheckBox)).Select(c => (CheckBox)c))
I get the following error:
"System.Windows.Forms.Controls cannot be used like a method."
I use .NET framework 4 client-profile and for sure use System.Linq
in code.
Any ideas?