How can I iterate through all checkboxes on a form?

c#, checkbox, winforms

Solution

foreach(Control c in this.Controls)
{
   if(c is CheckBox)
   {
   // Do stuff here ;]
   }
}

Problem

I have a form that has many dynamically generated checkboxes. At runtime, how can I iterate through each of them so I can get their value and IDs?

Original source