954,557 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

How to clear many textboxes in same time

Hi All,,
Same as the title,
Can we clear all textboxes in same time? this is possible?
Its consume many time to code if we have to write clear code for every textbox.

Best Regards

Sturdy
Light Poster
34 posts since Mar 2011
Reputation Points: 28
Solved Threads: 1
 

If you have array textboxes then you can use looping to clear text box :

Dim i as Integer
For i = 0 to 10
    txt(i).Text = ""
Next

Or you can check if the type of control is text box then clear the control text.

For Each txt In Form1.Controls
    If TypeOf txt Is TextBox Then txt.Text = ""
Next
Jx_Man
Nearly a Senior Poster
3,329 posts since Nov 2007
Reputation Points: 1,372
Solved Threads: 444
 

Thank you jx..
your code working great..

God Bless You.

Sturdy
Light Poster
34 posts since Mar 2011
Reputation Points: 28
Solved Threads: 1
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: