Results 1 to 5 of 5

Thread: [RESOLVED] [2005] Enumerating Resources

Threaded View

  1. #1

    Thread Starter
    Registered User nmadd's Avatar
    Join Date
    Jun 2007
    Location
    U.S.A.
    Posts
    1,676

    Resolved [RESOLVED] [2005] Enumerating Resources

    Hi all,
    I've begun playing with resources in .NET. Makes sense so far getting to the resources via the My.Resources namespace, but I have a question about looping through all my resources that are stored in the default Resources.resx file.

    Let's say, just for example, I have multiple icons in there and I want the user to select one for some reason at runtime. I have figured out that I can loop through them like this, but is there a more "VB 2005 way"? Is there some way to do this using the My.Resources namespace?

    vb.net Code:
    1. Dim assem As Assembly = Assembly.GetExecutingAssembly()
    2. Dim rr As New ResourceReader(assem.GetManifestResourceStream("MyApplication.Resources.resources"))
    3. Dim de As IDictionaryEnumerator = rr.GetEnumerator()
    4. Do While de.MoveNext()
    5.     ' Do something.
    6. Loop
    Last edited by nmadd; Aug 1st, 2007 at 02:02 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width