How to use the editor attribute?


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.
 
Ad

Advertisements

G

Guest

Hello,

I apologize for posting my Question in the wrong discussion group. I’m going
to post it again in the correct discussion group.

Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top