I'm creating a pretty neat program which implements the PropertyGrid control. Whenever I'm creating my own classes, using the PropertyGrid is fine because the properties it shows are the properties that I wrote. But whenever I inherit a control, it display's my custom properties as well as all the properties of that control that I inherited. Is there anyway around this where I can just display properties that I set up in my class? Ie -
That would only display:
Edit - I wound up hiding the properties like this:
Now I'm facing the issue that properties that cannot be overridden such as FlatStyle, UseMnemonic, UseWaitCursor, etc. still get shown.
Code:
Option Strict On
Option Explicit On
Public Class MenuItem
Inherits Button
Public Property Border As Boolean = True
Public Property BorderColor As Color = Color.Black
Public Property BorderThickness As Integer = 1
Public Property MouseDownColor As Color = Color.White
Public Property MouseHoverColor As Color = Color.White
Public Overrides Property Text As String
Get
Return MyBase.Text
End Get
Set(value As String)
MyBase.Text = value
End Set
End Property
End Class
- Border
- BordderColor
- BorderThickness
- MouseDownColor
- MouseHoverColor
- Text
Edit - I wound up hiding the properties like this:
Code:
<Browsable(False)> Public Overrides Property AllowDrop As Boolean
Get
Return MyBase.AllowDrop
End Get
Set(value As Boolean)
MyBase.AllowDrop = value
End Set
End Property