ImageList question

SIMIN

Regular
Joined
Mar 10, 2008
Messages
92
Hi,
I have an ImageList and load some pictures with the following names for example:

uk.gif
us.gif
uy.gif
uz.gif
va.gif

And so forth...
I can see the name of each icon in the Images Collection Editor, but not from code.

My question is that how can I get the image NOT BY INDEX but by the name of internal image?
For example get the image from ImageList by "us.gif"?
Thanks.
 
What version of VS are you using? In 2008 the following works fine
C#:
      foreach (string s in imageList1.Images.Keys)
                Debug.WriteLine(s);
however the 2002 version doesn't seem to support the Keys property (then again in 2002 the name doesn't show in the collection editor either).

If you are using VS2005 or later you might want to investigate using a resource file rather than an image list control.
 
Back
Top