Groups | Blog | Home
all groups > vb.net > february 2006 >

vb.net : TreeNode.Remove(Boolean notify) exception


Chris
2/5/2006 3:57:53 PM
[quoted text, click to view]

It is telling you that "Nodes" is set to nothing when you are calling Clear.

Try this:

if Nodes isnot nothing Nodes.Clear
Boni
2/5/2006 7:26:44 PM
Dear all,
I have a tree node inherited from TreeNode class. Sometimes when I call
Nodes.Clear() I get following exception.
I use .NET 2.0.50727.
Seems to be MS bug?
Any ideas?
Thanks
Boni

System.NullReferenceException: Object reference not set to an instance of an
object.
at System.Windows.Forms.TreeNode.Remove(Boolean notify)
at System.Windows.Forms.TreeNode.Clear()
at System.Windows.Forms.TreeNodeCollection.Clear()

AddThis Social Bookmark Button