I am working on a UserControl with multiple controls. One of them is a PictureBox and I have create an Image Property for it so user can change the image at Design Time.
My problem is with DefaultValue attribute. When user do right click on Image Property in Properties Window to Reset to it's initial image, gets Nothing. I have found this way below, which resets a color property to a specific RGB color. Ιs it possible to do something similar with an image?Code:Private _Image As Image = My.Resources.windows_flag_16_darkgrey <Category("Extra Properties")> <DisplayName("Image")> <DefaultValue(GetType(Image), "???")> <Description("")> Public Property Image As Image Get Return _Image End Get Set(ByVal value As Image) _Image = value PictureBox.Image = value End Set End Property
Thank you in advance!!!Code:<Category("Extra Properties")> <DisplayName("Color")> <DefaultValue(GetType(Color), "91,91,91")> <Description("")>




Reply With Quote
