You must use the following converter and editor: <b> [Editor("System.Windows.Forms.Design.ImageIndexEditor", typeof(UITypeEditor))] [TypeConverter(typeof(ImageIndexConverter))] </b>
This is an example from the SmartLibrary in C#
<b>
/// <summary> /// Internal store for "public int IconImageIndex" /// </summary> private int ixIconImageIndex = -1; /// <summary> /// Gets or sets the image list index value of the icon image displayed on the notification box. /// </summary> #if(Design_Time) [Category("Appearance")] [Description("Gets or sets the image list index value of the icon image displayed on the notification box.")] [Editor("System.Windows.Forms.Design.ImageIndexEditor", typeof(UITypeEditor))] [TypeConverter(typeof(ImageIndexConverter))] #endif public int IconImageIndex { get { return this.ixIconImageIndex; } set { this.ixIconImageIndex = value; } }
#if(Design_Time) /// <summary> /// The default value for (IconImageIndex) is (-1). /// Prevent Microsoft Visual Studio.NET repeating that value again in the automatically generated source code. /// </summary> // <returns>True (generate code), false (don't generate code)</returns> private bool ShouldSerializeIconImageIndex() { return (this.ixIconImageIndex == -1) ? false : true; } #endif
</b>
|