SIMIN Posted December 9, 2008 Posted December 9, 2008 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. Quote
Administrators PlausiblyDamp Posted December 9, 2008 Administrators Posted December 9, 2008 What version of VS are you using? In 2008 the following works fine 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. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.