Hallo liene Community,
ich versuche gerade meine Controls durch eine Action-List zu erweitern. Jedoch funktioniert sich nicht.
Mein Code:
Spoiler anzeigen
Natürlich existiert eine MetroTrackBarRegion-Klasse.
Es gibt keinen Fehler, bzw. es passier garnichts.
Danke im Vorraus.
ich versuche gerade meine Controls durch eine Action-List zu erweitern. Jedoch funktioniert sich nicht.
Mein Code:
VB.NET-Quellcode
- Public Class MetroTrackBarRegionDesigner
- Inherits System.Windows.Forms.Design.ControlDesigner
- Private lists As DesignerActionListCollection
- Private ReadOnly Property HostControl() As MetroTrackBarRegion
- Get
- Return DirectCast(Me.Control, MetroTrackBarRegion)
- End Get
- End Property
- 'Fügt die Action-Liste hinzu.
- Public Overrides ReadOnly Property ActionLists() As DesignerActionListCollection
- Get
- If lists Is Nothing Then
- lists = New DesignerActionListCollection()
- lists.Add(New MetroTrackBarRegionActionList(Me.Component))
- End If
- Return lists
- End Get
- End Property
- Protected Overrides Sub PostFilterProperties(ByVal properties As System.Collections.IDictionary)
- properties.Remove("BackgroundImage")
- properties.Remove("BackgroundImageLayout")
- properties.Remove("BorderStyle")
- properties.Remove("Font")
- properties.Remove("ForeColor")
- properties.Remove("RightToLeft")
- MyBase.PostFilterProperties(properties)
- End Sub
- End Class
- Public Class MetroTrackBarRegionActionList
- Inherits DesignerActionList
- Private _sep As MetroTrackBarRegion
- Private designerActionSvc As DesignerActionUIService = Nothing
- Public Sub New(ByVal component As IComponent)
- MyBase.New(component)
- _sep = DirectCast(component, MetroTrackBarRegion)
- Me.designerActionSvc = CType(GetService(GetType(DesignerActionUIService)), DesignerActionUIService)
- End Sub
- Public Property ColorLeft() As Color
- Get
- Return _sep.ColorScheme.LeftColor
- End Get
- Set(ByVal value As Color)
- _sep.ColorScheme.LeftColor = value
- End Set
- End Property
- Public Property ColorMiddle() As Color
- Get
- Return _sep.ColorScheme.MiddleColor
- End Get
- Set(ByVal value As Color)
- _sep.ColorScheme.MiddleColor = value
- End Set
- End Property
- Public Property ColorRight() As Color
- Get
- Return _sep.ColorScheme.RightColor
- End Get
- Set(ByVal value As Color)
- _sep.ColorScheme.RightColor = value
- End Set
- End Property
- Public Overrides Function GetSortedActionItems() As System.ComponentModel.Design.DesignerActionItemCollection
- Dim items As New DesignerActionItemCollection
- items.Add(New DesignerActionHeaderItem("Farb-Eigenschaften"))
- items.Add(New DesignerActionPropertyItem("ColorLeft", "LeftColor:", "Properties", "Die linke Farbe der Leiste."))
- items.Add(New DesignerActionPropertyItem("ColorMiddle", "MiddleColor:", "Properties", "Die Farbe der Leiste des ausgewählten Bereiches."))
- items.Add(New DesignerActionPropertyItem("ColorRight", "RightColor:", "Properties", "Die rechte Farbe der Leiste."))
- Return (items)
- End Function
- End Class
Natürlich existiert eine MetroTrackBarRegion-Klasse.
Es gibt keinen Fehler, bzw. es passier garnichts.
Danke im Vorraus.