N
Nicky Smith
Hello,
I've got a problem with a TreeView. I get a starnge error when trying
to call the .Remove method.
The method is called from a ContextMenu, when holding the stylus down
on a childnode.
I then call the Remove method like this:
If MessageBox.Show("Are you sure?", "Delete Item?",
MessageBoxButtons.YesNoCancel, _
MessageBoxIcon.Question, MessageBoxDefaultButton.Button2)
= DialogResult.Yes Then
Dim TN As TreeNode = TV1.SelectedNode
TV1.Nodes.Remove(TN)
End If
This throws an Arguement Out of Range exception, on the call to
Remove(). I don't undeerstand that, because the TN object does become
a valid tree node, and the Remove method accepts a TreeNode as an
argument!
What am I doing wrong?
I've got a problem with a TreeView. I get a starnge error when trying
to call the .Remove method.
The method is called from a ContextMenu, when holding the stylus down
on a childnode.
I then call the Remove method like this:
If MessageBox.Show("Are you sure?", "Delete Item?",
MessageBoxButtons.YesNoCancel, _
MessageBoxIcon.Question, MessageBoxDefaultButton.Button2)
= DialogResult.Yes Then
Dim TN As TreeNode = TV1.SelectedNode
TV1.Nodes.Remove(TN)
End If
This throws an Arguement Out of Range exception, on the call to
Remove(). I don't undeerstand that, because the TN object does become
a valid tree node, and the Remove method accepts a TreeNode as an
argument!
What am I doing wrong?