G
Guest
Dear Sir,
Please I need help on how to use the editor attribute. I am trying to learn
how to create User Controls. I created a UserControl using VB.NET that
contine a treeview control. I want to expose the treeview nodes collection
and support the design-time environment by using the Editor attribute. But
when I tried to use it I get the following error message:
(value of type 'System.Windows.Forms.TreeNodeCollection' cannot be converted
to '1-dimensional array of System.Windows.Forms.TreeNodeCollection') .
The editor attribute takes two parameters
(Typename as string, base typename as string)
(Typename as string, base typename as system.Type)
(Typename as system.type, base typename as system.Type)
I tried for many times during the last five days to resolve the problem but
I could not do it. Please some one help me and tell me how to write the
editor attribute the correct way.
The following is my tree node collection property:
<Browsable(True), _
Description("Gets the TreeView Nodes collection"), _
Category("TreeView"), _
DesignerSerializationVisibility(DesignerSerializationVisibility.Content), _
Editor(System.Windows.Forms.TreeNodeCollection,
System.Windows.Forms.TreeNodeCollection)> _
Public ReadOnly Property Nodes() As TreeNodeCollection()
Get
Return Me.tvTreeView.Nodes <------ (the error appears in this
line)
End Get
End Property
Thank you.
Please I need help on how to use the editor attribute. I am trying to learn
how to create User Controls. I created a UserControl using VB.NET that
contine a treeview control. I want to expose the treeview nodes collection
and support the design-time environment by using the Editor attribute. But
when I tried to use it I get the following error message:
(value of type 'System.Windows.Forms.TreeNodeCollection' cannot be converted
to '1-dimensional array of System.Windows.Forms.TreeNodeCollection') .
The editor attribute takes two parameters
(Typename as string, base typename as string)
(Typename as string, base typename as system.Type)
(Typename as system.type, base typename as system.Type)
I tried for many times during the last five days to resolve the problem but
I could not do it. Please some one help me and tell me how to write the
editor attribute the correct way.
The following is my tree node collection property:
<Browsable(True), _
Description("Gets the TreeView Nodes collection"), _
Category("TreeView"), _
DesignerSerializationVisibility(DesignerSerializationVisibility.Content), _
Editor(System.Windows.Forms.TreeNodeCollection,
System.Windows.Forms.TreeNodeCollection)> _
Public ReadOnly Property Nodes() As TreeNodeCollection()
Get
Return Me.tvTreeView.Nodes <------ (the error appears in this
line)
End Get
End Property
Thank you.