Showing posts with label ImageList. Show all posts
Showing posts with label ImageList. Show all posts

Friday, February 5, 2010

What is RelatedImageListAttribute?

One use of RelatedImageListAttribute is to tell ImageIndexEditor where to get the images.

Imagine a class called ClassA with a property called ImageKey, and another property called PropertyB, which is a structure with an ImageList property.

Then, this is how ImageKey should be described:

[Editor("System.Windows.Forms.Design.ImageIndexEditor, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(UITypeEditor))] [RefreshProperties(RefreshProperties.Repaint)] [RelatedImageList("PropertyB.ImageList")] [TypeConverterAttribute(typeof(ImageKeyConverter))] public string ImageKey { set; get; }