foreach (Control ctrl in this.Controls)
{
if (ctrl.GetType() == typeof(Panel))
{
foreach(Control panelControl in ctrl.Controls)
{
if (ctrl.GetType() == typeof(UserDefinedTextBox))
{
UserDefinedTextBox tb = ctrl as UserDefinedTextBox;
tb.ReadOnly = true;
}
}
}
}
|