Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Checklist and Controls[]

Status
Not open for further replies.

dansleight

IS-IT--Management
Dec 6, 2000
25
US
I'm trying to loop through the controls in a control and perform an action on each one. It works fine with most controls but doesn't include any checkbox controls. Any ideas?

for(int i=0;i<thisControl.Controls.Count;i++)
{
clearBindings(thisControl.Controls);
}

checkBox controls are skipped with this loop.
 
I believe the bindings on a checkbox are not quite the same as other controls.

I haven't tested this but you might want to try:

for(int i=0;i<thisControl.Controls.Count;i++)
{
if (thisControl.Contols.GetType() == chkYouCheckbox.GetType())
{
chkCheckBox.BindingContext = null;
}
else
{
clearBindings(thisControl.Controls);
}
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top