我有一个包含许多动态生成的复选框的表单。在运行时,我如何迭代它们中的每一个,以便获取它们的值和 ID?
foreach(Control c in this.Controls) { if(c is CheckBox) { // Do stuff here ;] } }