方法一:控件命名规律一些,如 checkbox_1、checkbox_2、checkbox_3
然后写成循环,如
For i As Integer = 1 to 3
If e.form.controls("checkbox_" & i).Checked Then
msgbox(i)
End If
Next
方法二:循环每一个控件,判断控件类型,如
For Each c As Object in e.form.Controls
If typeof c is winform.checkbox then