• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 509
  • Last Modified:

Custome Tree View Node crashes on .Clone()

Hi,

I have a vb.net 2003 app,

On SortNode.clone the app throws this exception :

System.MissingMethodException - No parameterless constructor defined for this object.

SortNode is a custom control which inherits System.Windows.Forms.TreeNode, nothing fancy in it just a load of extra integer properties specific to the app.

Im totally lost on how to get this to work; do I need to create an override constructor? if so how as iv never done this before,

Thanks

Ash
0
Ajfy2k
Asked:
Ajfy2k
  • 2
1 Solution
 
Bob LearnedCommented:
Do you have a Sub New (default constructor)?

Bob
0
 
Ajfy2kAuthor Commented:
Ye below is the sub new of  my custom control,

   Public Sub New(ByVal strText As String)
        Me.Text = strText
    End Sub

this the problem?

ash
0
 
Ajfy2kAuthor Commented:
Sorted, added additional sub new of

    Public Sub New()

    End Sub

And it now works,

Thanks,

ash
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now