I have created a new component: an IconList
But when I try to add an item in the collection editor the editor gives this error message:
Constructor on type System.Drawing.Icon not found
Thanks in advance
Code:
Public Class IconList
Inherits System.ComponentModel.Component
Private mnIcons As Icons = New Icons()
Public Property Icons() As Icons
Get
Return mnIcons
End Get
Set(ByVal Value As Icons)
mnIcons = Value
End Set
End Property
End Class
Public Class Icons
Inherits System.Collections.CollectionBase
Public Sub Add(ByVal ico As Icon)
List.Add(ico)
End Sub
Public Sub New()
MyBase.New()
End Sub
Public Sub Remove(ByVal index As Integer)
If index > Count - 1 Or index < 0 Then
MsgBox("Index not valid!")
Else
List.RemoveAt(index)
End If
End Sub
Public ReadOnly Property Item(ByVal index As Integer) As Icon
Get
Return CType(List.Item(index), Icon)
End Get
End Property
End Class
But when I try to add an item in the collection editor the editor gives this error message:
Constructor on type System.Drawing.Icon not found
Thanks in advance