Phil Lane

Phil Lane

  • NA
  • 5
  • 0

clearing all textboxes in a tabbed form

Feb 24 2008 5:28 AM

im trying to clear all textboxes in a tabbed form, im using:

foreach (Control tbpage in this.tabControl1.TabPages)
            {
                do
                    foreach (Control txt in this.tbpage.Controls)
                    {
                        if (txt.GetType() == typeof(System.Windows.Forms.TextBox))
                        {
                            txt.Text = "";
                        }
                    }
                while (this.tabControl1.TabCount > loop);
                loop = loop + 1;
            }

 

but it is not working!

can anyone help?

sorry if this is really basic but i am a newbie!


Answers (5)