Image Property Definition
-
OK, what is wrong with this property definition in a control? In the properties list the little empty box displays next to the name and the dot-dot-dot button works correctly, but when I select a file nothing is every filled-in and the resource is not serialized in the InitializeComponent() call. I suspect it is a serialization issue but I have tried both Visible and Content to no effect. [ CategoryAttribute("Appearance"), DescriptionAttribute("Image that appears when control is down."), BrowsableAttribute(true), EditorAttribute("System.Drawing.Design.ImageEditor, System.Design",typeof(UITypeEditor)), DesignerSerializationVisibility(DesignerSerializationVisibility.Visible), TypeConverter(typeof(System.Drawing.Bitmap)), DefaultValueAttribute(null) ] public Bitmap ImageDown { get { return null; } set { _imageDown = (Bitmap)value; } }
-
OK, what is wrong with this property definition in a control? In the properties list the little empty box displays next to the name and the dot-dot-dot button works correctly, but when I select a file nothing is every filled-in and the resource is not serialized in the InitializeComponent() call. I suspect it is a serialization issue but I have tried both Visible and Content to no effect. [ CategoryAttribute("Appearance"), DescriptionAttribute("Image that appears when control is down."), BrowsableAttribute(true), EditorAttribute("System.Drawing.Design.ImageEditor, System.Design",typeof(UITypeEditor)), DesignerSerializationVisibility(DesignerSerializationVisibility.Visible), TypeConverter(typeof(System.Drawing.Bitmap)), DefaultValueAttribute(null) ] public Bitmap ImageDown { get { return null; } set { _imageDown = (Bitmap)value; } }
No wonder your Bitmap is empty - you always return null... X| I guess changing
get
{
return null;
}into
get
{
return _imageDown;
}could do the trick. Regards, mav