Adding PictureBoxes during runtime (vb .net 2003)

G

Guest

hi,

i would like to add pictureboxes during runtime, but there should not be a
specific variable for each picturebox becouse i don't know how much it will
be. so i declared a collection referencing on one var declared as picturebox.
it works fine to add the controls this way. now i would like to implement one
picturebox click handle for each added picturebox and i have no idea how to
do this.

Friend WithEvents Device As PictureBox
Dim Devices As New Collection
.....
Device = New PictureBox
Devices.Add(Device, DeviceID)
Me.Controls.Add(Devices(DeviceID))
....
 
P

Patrick Steele

now i would like to implement one
picturebox click handle for each added picturebox and i have no idea how to
do this.

See the "AddHandler" statement.
 

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

Top