Hi,
void ClearText(Control c)
{
foreach(Control cc in Controls)
{
Textbox tb = cc as Textbox;
if( tb != null )
tb.Text = string.Empty;
else
ClearText(cc); // recursion required for panels/groups etc
}
}
I would change it by
void ClearText(Control c)
{
foreach(Control cc in Controls)
{
Textbox tb = cc as Textbox;
if( tb != null )
tb.Text = string.Empty;
if ( cc.Controls.Count >0 )
ClearText(cc); // recursion required for panels/groups etc
}
}
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation