5
Answers

clearing all textboxes in a tabbed form

Phil Lane

Phil Lane

16y
3.5k
1

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)