creating click events to controls created in runtime

  • Thread starter Thread starter Timothy Taylor
  • Start date Start date
T

Timothy Taylor

Hello,
I need all the help I can get...
I am making a picture explorer program and I need to make a thumbnail view.
I plan on browsing for images in a certain folder and showing a thumbnail
view of them.
Here are my problems that I cannot figure out....

I want to create a new picturebox for every image in the directory chosen.
However I want to be able to have control. At least what I'm saying is I
need to after I create the pictureboxes I need to have a click event for
them. Can't I create a bunch of new pictureboxes, and then tell them all to
have a click event that goes to an already made function or sub?

Another way I could do it is to draw the images on the form or in a panel
using the drawing class. But I have a problem with that... I want to have
thumbnail, so I need to shrink the picture down!
Is there any VB.NET CF (what I'm working in) code to open a image into a
bitmap, but before drawing it on the screen or before inserting it into a
picture box for it to shrink it to be a certain size? I need a smaller
version of the image that is proportional to the real image. I also need to
do this instead of picture box that stretches the images because if my user
opens a folder with say...20 large images it's going to take forever to load
all the images full blown into pictureboxes! I need a smaller, quicker
solution.

Any suggestions, code, websites??

Any help is much appreciated!

Thanks so much in advance,

-Tim
 
Back
Top