Filling an ImageList with images from a resource file

The support for resources has dramatically improved in VS.NET 2005, however, one thing still bothers me.  If I create an ImageList object, there doesn't appear to be a way to add images to the ImageList from a resource file (aside from programmatically, of course).  Am I overlooking something



Answer this question

Filling an ImageList with images from a resource file

  • izadyas

    root,
    I would guess that this is by design. Loading resources by invoking either Assembly.GetManifestResourceStream or the ResourceManager is simple and straightforward.

  • Jana Carter

     ursus zeta wrote:
    root,
    I would guess that this is by design. Loading resources by invoking either Assembly.GetManifestResourceStream or the ResourceManager is simple and straightforward.


    By design in VS.NET 2003, perhaps, but it simply doesn't make sense with the new resource model in 2005.  For nearly every other control that contains an image you can directly reference an embedded image resource through designer mechanisms.  Sure, its simple enough to do it programmatically for the ImageList:



    this.imageList1.Images.Add(Resources.SomeImage);
    this.imageList1.Images.Add(Resources.SomeOtherImage);

     


    but I really want the designer functionality.

  • Filling an ImageList with images from a resource file