Ignotus_Navigator

Hello, friends...

With this code, I add a sibling node after the selected node. This works fine, but ifI write something in the node (the label node) it desappears after it is edited. That what I wrote is changed by a blank.

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click

'We add a sibling node after the selected node.

TView.SelectedNode.Parent.Nodes _

.Insert(TView.SelectedNode.Index + 1, New TreeNode)

'We edit the node.

TView.LabelEdit = True

TView.SelectedNode.NextNode.BeginEdit()

End Sub

Any suggestions

Thanks in advance,

Jim



Re: Visual Basic Express Edition I can't write a TreeView label in a node.

whw61

this will add a main node

TView.Nodes.Add(TextBox1.Text)

TView.ExpandAll()

to add a node to the selected node use

TView.SelectedNode.Nodes.Add(TextBox1.Text)

TView.ExpandAll()





Re: Visual Basic Express Edition I can't write a TreeView label in a node.

Ignotus_Navigator

That works fine!

Thank you, whw61

Jim