I'm trying to figure out how I can implement a Click selection event for my movie manager/database. I want to be able to click a PictureBox in order to retrieve its information (movie name) which I've already implemented for a set PictureBox that I created from the toolbox.
However, for the whole database I display all of a user's database using a For loop that creates a new PictureBox for every film, displaying their poster pictures when the form is loaded; the panel contains all the small images seen in an image I uploaded to imgur here: Film Manager.
Obviously for a PictureBox with a set name created by a toolbox and named, all you do is make a click event for it then provide the selection code (which I already have) within that event. But what about for my current situation, whereby PictureBoxes are created during runtime/loading of the form, depending on a user's database? I don't know the name of these PictureBoxes so I have no idea how to create an event for each of them.
However, for the whole database I display all of a user's database using a For loop that creates a new PictureBox for every film, displaying their poster pictures when the form is loaded; the panel contains all the small images seen in an image I uploaded to imgur here: Film Manager.
Obviously for a PictureBox with a set name created by a toolbox and named, all you do is make a click event for it then provide the selection code (which I already have) within that event. But what about for my current situation, whereby PictureBoxes are created during runtime/loading of the form, depending on a user's database? I don't know the name of these PictureBoxes so I have no idea how to create an event for each of them.