I have a flowLayoutPanel that I programmatically add to the new panelLayouts. Each panelLayout has a pictureBox inside it. All of this works great, but I need to determine when this picture is clicked. How to add an event to a picture? It seems I can only find C # examples ....
my code for adding an image is as follows:
' add pic to the little panel container Dim pic As New PictureBox() pic.Size = New Size(cover_width, cover_height) pic.Location = New Point(10, 0) pic.Image = Image.FromFile("c:/test.jpg") panel.Controls.Add(pic) 'add pic and other labels (hidden in this example) to the big panel flow albumFlow.Controls.Add(panel)
So, I assume that when I create the image, I add the onclick event. I need to get an index for it, if possible! Thanks for any help!
source share