[2005] How to get Images from Resource
i have 18 images in the resource named as img1,img2,img3.....img18. And also i have an listbox with 18 items.
so what i want is
when the first item of the listbox is selected then img1 should be loaded in the picturebox and similarly the if 2nd item is selected then img2 must be loaded and so on for all the 18 images
is there an any other way instead of using multiple if statements?
Plz help
Re: [2005] How to get Images from Resource
Put all your Images into an array, then use the SelectedIndex of the ListBox to get the corresponding Image.
Re: [2005] How to get Images from Resource
instead of using an array of images can an array of image reference can be used? If yes please let me know how
Re: [2005] How to get Images from Resource
Quote:
Originally Posted by aashish_9601
instead of using an array of images can an array of image reference can be used? If yes please let me know how
Image is a class so it's a reference type, therefore an array of Images already IS an array of Image references.