R
Rohan
I need to use the Collection editor of the propertyGrid, but i can't
this to work, i looked around on the NET on collection and I am kinda
lost. i have this so far, i don't know what i should do next
Thank you
Public class frmColor
Dim xColors As New myColors
'Form Load event
PropertyGrid1.SelectedObject = xColors
End Class
Public Class myColors
Dim CustomC As CC_Collection
<TypeConverter(GetType(CollectionConverter)), DisplayName("test")>
_
Public Property test() As CC_Collection
Get
Return CustomC
End Get
Set(ByVal value As CC_Collection)
CustomC = value
End Set
End Property
End Class
Public Class CC_Collection
Private _name As String
Private _Color As Color
Public Sub New(ByVal [Name] As String, ByVal CColor As Color)
_name = Name
_Color = CColor
End Sub
Public Property Name() As String
Get
Return _name
End Get
Set(ByVal value As String)
_name = value
End Set
End Property
Public Property CColor() As Color
Get
Return _Color
End Get
Set(ByVal value As Color)
_Color = value
End Set
End Property
End Class
this to work, i looked around on the NET on collection and I am kinda
lost. i have this so far, i don't know what i should do next
Thank you
Public class frmColor
Dim xColors As New myColors
'Form Load event
PropertyGrid1.SelectedObject = xColors
End Class
Public Class myColors
Dim CustomC As CC_Collection
<TypeConverter(GetType(CollectionConverter)), DisplayName("test")>
_
Public Property test() As CC_Collection
Get
Return CustomC
End Get
Set(ByVal value As CC_Collection)
CustomC = value
End Set
End Property
End Class
Public Class CC_Collection
Private _name As String
Private _Color As Color
Public Sub New(ByVal [Name] As String, ByVal CColor As Color)
_name = Name
_Color = CColor
End Sub
Public Property Name() As String
Get
Return _name
End Get
Set(ByVal value As String)
_name = value
End Set
End Property
Public Property CColor() As Color
Get
Return _Color
End Get
Set(ByVal value As Color)
_Color = value
End Set
End Property
End Class