Discussion Locked

can I delete picturebox in runtime in VB

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

how can I delete picture boxes or controls in runtime from a form in VB.

plz help

thanks in advance

5 replies

by rr31

I'm not to sure you can remove them completely at runtime, but you can hide them with:
control.visible = false
Hope that helps some.

by salini_m_s

Thanks for answering. but I want to delete the controls becoz I"m using a loop to place the controls and when rightclick control and click delete it will be deleted, thats my need.

by rrv

This will be the code

For each Ctl in me.controls
if TypeName(Ctl)="PictureBox" then
ctl.unload
end if
next

This discussion is closed to new replies.