Maybe it's a noob question ... anyway, I create a dynamic number of PictureBox controls.
I keep them inside a List.
What I want now is to make them clickable: same event handler for all (opening of the image source file) with a parameter.
The question is: how can I do it in practice?
How I set the handler Sub for every picbox?
Thanks a lot
fabio.bozzo 0
Newbie Poster
Recommended Answers
Jump to PostPrivate Sub MethodThatCreatesDynamicPictureBoxes() 'Your code for dynamically creating picturebox AddHandler yourPicBox.Click, AddressOf picbox_Click End Sub Private Sub picbox_Click(ByVal sender As Object, ByVal e As System.EventArgs) 'Every time a picturebox is clicked, this variable will contain THAT picturebox Dim picBox As PictureBox = DirectCast(sender, PictureBox) 'Do something with …
All 3 Replies
Oxiegen 88
Basically an Occasional Poster Featured Poster
fabio.bozzo 0
Newbie Poster
Luigiview 0
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.