Loop through all controls in a user cont...
Posted by Robin in
.Net on 02 21st, 2010 |
No Comments
Task :
You have a user control. And you want to loop through all the controls in that user control.
You write the following code
foreach (Control ctrl in control.Controls)
{
//Do your task.
}
And you are wrong.
Reason :
As you know, all the forms/Usercontrols have a control collection. A control collection...