Uncheck 20 checkboxes

phillip

Freshman
Joined
Aug 28, 2003
Messages
37
I have 20 checkboxes
Is it possible to uncheck them all without listing eachone in turn

they are call check1 to check20

Thanks
 
If you want to check every checkbox contained directly by the form (i.e. not in a panel/group box/etc.) you could do this:
Visual Basic:
For Each Item As Control In Me.Controls
    If Typeof Item Is CheckBox Then
        DirectCast(Item, CheckBox).Checked=False
    End If
Next Item
Likewise, you could do this to a panel's control collection, or any other container control.
 
Back
Top