Actionlist wird nicht angezeigt

  • Allgemein

Es gibt 2 Antworten in diesem Thema. Der letzte Beitrag () ist von Gather.

    Actionlist wird nicht angezeigt

    Hallo liene Community,
    ich versuche gerade meine Controls durch eine Action-List zu erweitern. Jedoch funktioniert sich nicht.
    Mein Code:
    Spoiler anzeigen

    VB.NET-Quellcode

    1. Public Class MetroTrackBarRegionDesigner
    2. Inherits System.Windows.Forms.Design.ControlDesigner
    3. Private lists As DesignerActionListCollection
    4. Private ReadOnly Property HostControl() As MetroTrackBarRegion
    5. Get
    6. Return DirectCast(Me.Control, MetroTrackBarRegion)
    7. End Get
    8. End Property
    9. 'Fügt die Action-Liste hinzu.
    10. Public Overrides ReadOnly Property ActionLists() As DesignerActionListCollection
    11. Get
    12. If lists Is Nothing Then
    13. lists = New DesignerActionListCollection()
    14. lists.Add(New MetroTrackBarRegionActionList(Me.Component))
    15. End If
    16. Return lists
    17. End Get
    18. End Property
    19. Protected Overrides Sub PostFilterProperties(ByVal properties As System.Collections.IDictionary)
    20. properties.Remove("BackgroundImage")
    21. properties.Remove("BackgroundImageLayout")
    22. properties.Remove("BorderStyle")
    23. properties.Remove("Font")
    24. properties.Remove("ForeColor")
    25. properties.Remove("RightToLeft")
    26. MyBase.PostFilterProperties(properties)
    27. End Sub
    28. End Class
    29. Public Class MetroTrackBarRegionActionList
    30. Inherits DesignerActionList
    31. Private _sep As MetroTrackBarRegion
    32. Private designerActionSvc As DesignerActionUIService = Nothing
    33. Public Sub New(ByVal component As IComponent)
    34. MyBase.New(component)
    35. _sep = DirectCast(component, MetroTrackBarRegion)
    36. Me.designerActionSvc = CType(GetService(GetType(DesignerActionUIService)), DesignerActionUIService)
    37. End Sub
    38. Public Property ColorLeft() As Color
    39. Get
    40. Return _sep.ColorScheme.LeftColor
    41. End Get
    42. Set(ByVal value As Color)
    43. _sep.ColorScheme.LeftColor = value
    44. End Set
    45. End Property
    46. Public Property ColorMiddle() As Color
    47. Get
    48. Return _sep.ColorScheme.MiddleColor
    49. End Get
    50. Set(ByVal value As Color)
    51. _sep.ColorScheme.MiddleColor = value
    52. End Set
    53. End Property
    54. Public Property ColorRight() As Color
    55. Get
    56. Return _sep.ColorScheme.RightColor
    57. End Get
    58. Set(ByVal value As Color)
    59. _sep.ColorScheme.RightColor = value
    60. End Set
    61. End Property
    62. Public Overrides Function GetSortedActionItems() As System.ComponentModel.Design.DesignerActionItemCollection
    63. Dim items As New DesignerActionItemCollection
    64. items.Add(New DesignerActionHeaderItem("Farb-Eigenschaften"))
    65. items.Add(New DesignerActionPropertyItem("ColorLeft", "LeftColor:", "Properties", "Die linke Farbe der Leiste."))
    66. items.Add(New DesignerActionPropertyItem("ColorMiddle", "MiddleColor:", "Properties", "Die Farbe der Leiste des ausgewählten Bereiches."))
    67. items.Add(New DesignerActionPropertyItem("ColorRight", "RightColor:", "Properties", "Die rechte Farbe der Leiste."))
    68. Return (items)
    69. End Function
    70. End Class


    Natürlich existiert eine MetroTrackBarRegion-Klasse.
    Es gibt keinen Fehler, bzw. es passier garnichts.


    Danke im Vorraus.
    Mfg: Gather
    Private Nachrichten bezüglich VB-Fragen werden Ignoriert!


    X(
    Komplett vergessen.

    Thread kann gelöscht werden ^^
    Mfg: Gather
    Private Nachrichten bezüglich VB-Fragen werden Ignoriert!