I apologize if the terminology is incorrect – not sure whether to call it an inherited control, custom control, or user control. Anyway please keep in mind this is a compact framework 3.5/smart device development question. I have a control that I have made that inherits from a button. Basically it draws a gradient and rounds the corners. I have 6 custom properties that I have added to this control. I noticed that when I set the value of one of these properties in the property window in the designer, I can never “reset” the value (ie right mouse click -> reset). The issue is that one of those properties is an image and now the only way to clear that image is to delete the button from the form and recreate it. I tried setting a default value in DesignTimeAttributes.xmta file for all the properties but that didn’t seem to help. “Reset” is still disabled. Any help is appreciated. Code from the Image property of the class follows:
Private _Image As Bitmap = Nothing
Public Property Image() As Bitmap
Get
Return _Image
End Get
Set(ByVal value As Bitmap)
_Image = value
Invalidate()
End Set
End Property
Try this:
You can always create Reset method for any Property:
Note: The designer won’t call the Reset method if you set the DefaultValue in Xmta.