Preload all images

Graham

Member
Joined
Feb 17, 2007
Messages
13
Programming Experience
5-10
I have a form with images that I want the user to be able to change,
I guess it's skinning,
how can I use the view folder to navigate to a folder on the users hard drive and have all the images in that folder preloaded so when the form loads it uses the images that are in that folder?
 
VB.NET:
Picturebox123.Image = Image.FromFile(path)
The Load event of form happen before form is shown, so the form can configure itself here.
Or you use the constructor or properties or configuration method if configuring from some other form that creates this instance.
 
Thanks John I already have this, but each time the button is clicked the program goes off and reloads the images, what I want is for them to all be pre loaded in the forms load event so that they are only loaded once and then after that are just refered to, hope this makes sense.
Below is sum of the code
DIYButton.BackgroundImage = Image.FromFile(ChosenPath & "\DIY.gif")
PaintButton.BackgroundImage = Image.FromFile(ChosenPath & "\Paint.gif")
ArtistButton.BackgroundImage = Image.FromFile(ChosenPath & "\Artistcol.gif")
 
I don't understand what 'button click' has to do with this? The program doesn't go off and do anything unless you tell it to/code it.
 
Back
Top