jeudi 26 mars 2015

Unchecked all checkbox in a form inside a groupbox inside a panel and another panel

Ok. im getting tired of clearing all checkboxes inside a groupbox inside another panel in my form. i have a code that can clear all checkboxes in my form inside the panel221.



For Each element As Control In Me.Panel221.Controls
If TypeOf element Is CheckBox Then
DirectCast(element, CheckBox).Checked = False
End If
Next


but i dont know why i cant clear all checkboxes in my form by just using this code.



For Each element As Control In Me.Controls
If TypeOf element Is CheckBox Then
DirectCast(element, CheckBox).Checked = False
End If
Next


this is the structured of my form:



-FORM
-PANEL 1
-GroupBox 1
-PANEL 2
-PANEL 3
* Several CheckBox inside another panel
-END OF PANEL 3
-END OF PANEL 2
-END OF GROUPBOX 1
'Another groupbox
-GroupBox 2
-PANEL 4
-PANEL 5
* Several CheckBox inside another panel
-END OF PANEL 5
-END OF PANEL 4
-END OF GROUPBOX 2
-END OF PANEL 1
-END OF FORM


so how can i clear or unchecked all that checkbox under a several groupbox and panel? anyone can help me?... thanks a lot! any help will appreciate! sorry for my bad english. Thanks!!!





Aucun commentaire:

Enregistrer un commentaire