private void btnClear_Click(object sender, EventArgs e)
{
ClearControls(this);
}
private void ClearControls(Control c)
{
foreach (Control ctrl in c.Controls)
{
if (ctrl is TextBox)
{
ctrl.Text = "";
}
else
{
if (ctrl.Controls.Count > 0)
{
ClearControls(ctrl);
}
}
}
}
{
ClearControls(this);
}
private void ClearControls(Control c)
{
foreach (Control ctrl in c.Controls)
{
if (ctrl is TextBox)
{
ctrl.Text = "";
}
else
{
if (ctrl.Controls.Count > 0)
{
ClearControls(ctrl);
}
}
}
}
0 التعليقات:
إرسال تعليق