Link to home
Start Free TrialLog in
Avatar of yo_daz_uk
yo_daz_uk

asked on

Delete a text box

Hi,

Is it possibe to delete a textbox from a form programmtaically?

I was looking for something like

textbox1.remove

but could not find it.

Daz
Avatar of Fernando Soto
Fernando Soto
Flag of United States of America image

Try this

        TextBox1.Dispose()

Fernando
Avatar of sr101880
sr101880

yes, it's : textbox1.dispose

let me know if you have any problems.
Yes sr101880 that is what I told yo_daz_uk to do.
sorry, your comment wasn't on my screen when I hit submit.  No hard feelings. :-)  yo_daz_uk , Please disregard my comment.
No problem sr101880 and you have a great day. ;=)
If you want to remove the textbox from the form but to use its properties anyway for any reason.
use:
 Me.Controls.Remove(TextBox1)
=> This line is valid if the textbox is placed on the form.
If it is placed on a panel or groupbox or any other container use that container's controls array

But if you want to delete the textbox not only from the form but also from the memory, then use the method that FernandoSoto and sr101880 propesed.
Avatar of yo_daz_uk

ASKER

Thanks its in a hast table is the also a way to empty a hash table ?
ASKER CERTIFIED SOLUTION
Avatar of Fernando Soto
Fernando Soto
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks fernado, i knew it was something basic i just couldnt find the answer!