Image Array
I want the user to be able to click on a folder and have the images gif and jpg in that folder placed in an array so that I can then use them as backgrounds for buttons
ie
Button1.backgroundimage = imagearray(0)
Button2.backgroundimage = imagearray(1)
Button3.backgroundimage = imagearray(2)
etc
How would I best code this?
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.

Scott LysleRank #49 · 31K reputationPosted Apr 11, 2007, 10:10 PM EDT
Add an image:
ImageList1.Images.Add(99, Image.FromFile("C:\Temp\SomeImage.jpg"))
Remove an image:
ImageList1.Images.RemoveAt(99);
Set a button to use an image (with the image list already assigned to the button):
Button1.ImageIndex = 4