1

I'm inheriting a Control, with the goal of overriding the value of the DefaultValue attribute of some properties. However, to do this I need to add some boilerplate to create "proxies" to the parent class's properties, like this:

<DefaultValue("new_default_value")> _
Public Overloads Property SomeProperty As String
    Get
        Return MyBase.SomeProperty
    End Get
    Set(value As String)
        MyBase.SomeProperty = value
    End Set
End Property

My question is, is there any better way of overriding the value of the DefaultValue attribute without using this? As long as its usable/visible from the Visual Studio Form Designer.

fableal
  • 1,577
  • 10
  • 24
  • This makes little sense. You want the default value to be editable in the Properties window?? – Hans Passant Sep 25 '12 at 12:30
  • @HansPassant No, I want to change the default value of properties in a base class (which I'm already doing using the above method, but I'm trying to find a better way of achieving that). These "default values" refer to the values that the control has in its properties when one creates a new control in a form. – fableal Sep 25 '12 at 12:37

0 Answers0