Rinki

Rinki

  • 499
  • 2.4k
  • 32.4k

Programing in WPF

Jan 26 2017 9:27 AM

 i want to create a function to clear all textbox
 ============================================
private void BTN_FORM_Click(object sender, EventArgs e)
{
foreach (Control x in Controls)

//foreach (Control c in Controls)
{
if (c is TextBox)
{
c.Text = "";
}
}
===============================
 this code is giving error
"  the name 'controls' does not exist in current context" ;
 
Please help its very urgent
Thanks in advance.
 

Answers (1)