Hi all,
I have a class that add or remove several picture boxes (up to 49) dynamically to a form, this works great.
The issue is that I can only raise events for the last picturebox created on my form.
Private WithEvents PBox As PictureBox
'is the declaration for the picture box, all the pictureboxes are set in a loop with the following code
Set PBox = mCallingForm.Controls.Add("vb.picturebox", "PicBox" & irow & icol, mCallingForm)
irow and icol are counters that will increment when the row and columns change. This works great!
private PBox_Click()
msgobx("I'm picturebox " & PBox.name"
end sub
How do I get the events of the other picture boxes?
Thankyou in advance,
Marble
I have a class that add or remove several picture boxes (up to 49) dynamically to a form, this works great.
The issue is that I can only raise events for the last picturebox created on my form.
Private WithEvents PBox As PictureBox
'is the declaration for the picture box, all the pictureboxes are set in a loop with the following code
Set PBox = mCallingForm.Controls.Add("vb.picturebox", "PicBox" & irow & icol, mCallingForm)
irow and icol are counters that will increment when the row and columns change. This works great!
private PBox_Click()
msgobx("I'm picturebox " & PBox.name"
end sub
How do I get the events of the other picture boxes?
Thankyou in advance,
Marble