|
-
Jun 27th, 2008, 01:14 AM
#1
Thread Starter
Frenzied Member
[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
-
Jun 27th, 2008, 01:18 AM
#2
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.
-
Jun 27th, 2008, 01:21 AM
#3
Thread Starter
Frenzied Member
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
-
Jun 27th, 2008, 02:27 AM
#4
Re: [2005] How to get Images from Resource
 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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|