how to add TreeNode to TreeNodeCollection?
Posted on 2006-06-25
how to correctly add TreeNode to TreeNodeCollection? i have tried the following:
Dim tnc As TreeNodeCollection
Dim tn As New TreeNode
tn.Text = "TEST NODE"
when i call this code i get System.NullRefernceException error 'Object reference not set to an instance of an object". however the TreeNodeCollection data type does not have constructors (i cannot use the New keyword). so how do i use the TreeNodeCollection? more generally, can i use TreeNodeCollection as a non-visual TreeView?