Removing a Picture Box
-
I have a subroutine that creates new pictureboxes when a user clicks a button. Here is a condensed version:
ReDim Preserve Picbox(array\_size) For index As Integer = 0 To array\_size Picbox(index) = New PictureBox Next For index As Integer = 0 To array\_size Me.Controls.Add(Picbox(index)) Picbox(index).Image = blip Next
Now, I need to know how to be able to remove a picturebox, or otherwise manipulate the new pictureboxes. When I modify/erase pictures in the array, nothing happens to the pictureboxes on the form. How can I manipulate these new pictureboxes?
-
I have a subroutine that creates new pictureboxes when a user clicks a button. Here is a condensed version:
ReDim Preserve Picbox(array\_size) For index As Integer = 0 To array\_size Picbox(index) = New PictureBox Next For index As Integer = 0 To array\_size Me.Controls.Add(Picbox(index)) Picbox(index).Image = blip Next
Now, I need to know how to be able to remove a picturebox, or otherwise manipulate the new pictureboxes. When I modify/erase pictures in the array, nothing happens to the pictureboxes on the form. How can I manipulate these new pictureboxes?
-
If you want to remove a specific picturebox according to your code, use dispose method as shown below. Picbox(index).dispose I think that should work! :wtf:
What a curious mind needs to discover knowledge is noting else than a pin-hole.