How do I add a design-time description to a property implemented through an extension provider?
I know that I can add a Design-time Designer description to a custom control property by doing the following:
<Category("Data"), Description("This describes this awesome property")>
Public Property Foo As Boolean
...
End Property
What I want to do is the same, but the properties that my extension provider component exposes to other controls on my form, so that when I click on the property value field, for For example, I would see the description I wrote for him. Searched a lot for an answer but no success yet. Should I add something to my getter and setter methods for the property?
Thank.
source to share
Would I have to add something to my getter and setter methods for the property?
Yes. Add a method DescriptionAttribute
to a method Get[PropertyName]
. The same goes for any other attributes (they don't seem to work with Set
...).
<Category("ListContolExtender"), DisplayName("DisplayMode"),
Description("My very clever description")>
Public Function GetDisplayMode(ctl As Control) As ItemDisplays
If extData.ContainsKey(ctl) Then
Return extData(ctl).DispMode
Else
Return ItemDisplays.Enabled
End If
End Function
Public Sub SetDisplayMode(ctl As Control, v As ItemDisplays)
If extData.ContainsKey(ctl) Then
extData(ctl).DispMode = v
Else
Dim e As New ExtenderData
e.DispMode = v
extData.Add(ctl, e)
End If
End Sub
DisplayNameattribute
hides all DisplayMode on ListBoxExtender
verbiage
source to share