text box clear at a single instance

  • Thread starter Thread starter Lal
  • Start date Start date
L

Lal

dear all
On my project all forms have 10-25 text boxes, i want to clear these text
boxes.
insted of typing .clear on every text boxes any single command for a
particular form

i am new in .net

please help me

regards
lal
 
Lal,

Assuming the textboxes are direct on the form, than this is the easiest one.

for each ctr as control in me.controls
If typeof ctr Is Textbox then
ctr.text = ""
end if
next

When there are textboxes on panels or groupboxes tell that than, because
than I prefer a recursive method, which I show than.

This one is to understand it easily

I hope this helps?

Cor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top