Computer Science Canada

Clear All Button Code

Author:  12yearoldprogrammer [ Tue Feb 21, 2012 5:57 pm ]
Post subject:  Clear All Button Code

Hey I'm looking For the code that clears or resets All TextBoxes? Anything that works will Help Thanks

Author:  Night [ Sun Feb 26, 2012 1:44 am ]
Post subject:  RE:Clear All Button Code

You might have to do everything manually, e.g.:

code:
Textbox1.Text = Nothing
Textbox2.Text = Nothing
Textbox3.Text = Nothing
Textbox4.Text = Nothing


* VB.NET code, use = null in VB6 or = "" in either

or you might get away with unloading and reloading the form (might have to have a separate form to do that).

There's probably an easier/better way, though I can't test any at the moment.

Author:  D_homes [ Mon Apr 09, 2012 5:56 pm ]
Post subject:  Re: Clear All Button Code

Yea, it has to be done manually. If you've got your TextBoxes in a control array it would be easier to clear them out though.

i.e
code:
For x As Integer = 1 To numberOfTextBoxes
     txtBox(x).Text = Nothing
Next


: