Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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.

  • Administrators
Posted

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.

Posting Guidelines FAQ Post Formatting

 

Intellectuals solve problems; geniuses prevent them.

-- Albert Einstein

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...