Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to delete Run-time created controls ?

Status
Not open for further replies.

gaudibri

Programmer
Dec 6, 2002
19
FR
Hi everybody,

A pink star for the one who could help me deleting dynamically-created controls with then .Controls.Add method.

Thanks in advance for all those who will take part in this great contest :)
 
faq222-3906 check the faqs before asking ;)

~*Gwar3k1*~
"To the pressure, everything's just like: an illusion. I'll be losing you before long..."
 
Re-Check my question before answering, the FAQ doesn't explain how to remove controls created with Controls.Add().

Regards.
 
fair doos

~*Gwar3k1*~
"To the pressure, everything's just like: an illusion. I'll be losing you before long..."
 
form1.Controls.remove("objectName")

sorry if this is wrong. i did a search on google after feelin bad about the 1st post

~*Gwar3k1*~
"To the pressure, everything's just like: an illusion. I'll be losing you before long..."
 
VB reply it can't unload in this context.

Thanks anyway for helping.
 
Use the Unload function. i.e:

Unload MyControl

If it has an index ( part of a control array ) then refer to the index in the Unload:

Unload MyControl(index)

Note that unloading of controls is not permitted in certain subs, like in the click events for combo boxes.

HTH,

Robert
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top