G
Guest
Hello
I am writing an application in VB.NET that utilizes a treeview. I want to allow my users to add new nodes to the treeview
In my code, I dimension a treenode and set the tree node text to "Type New Process Category Name.
I then set the treeview LabelEdit property to True and call the BeginEdit method
Everything works fine, but before the user can edit the treenode data, he or she must first click on the treenode to activate the edit mode
How can I provide this click event for my customer, so he or she does not have to click on the node first. I would like my customer to just begin typing without requiring them to click on the node. Is this possible
A snippet of my code is below. I appreciate any feedback or suggestions
Best regards
Ma
Dim intSelectedTreeNode As Integer = -
Dim tn As New TreeNod
tn.Text = "Type New Process Category Name
If Me.trePCM_Process.SelectedNode Is Nothing The
Me.trePCM_Process.Nodes.Insert(0, tn
Els
intSelectedTreeNode = Me.trePCM_Process.SelectedNode.Inde
Me.trePCM_Process.Nodes.Insert((intSelectedTreeNode + 1), tn
End I
'-- Now select the newly inserted node
Me.trePCM_Process.SelectedNode = t
Me.trePCM_Process.LabelEdit = Tru
If Not Me.trePCM_Process.SelectedNode.IsEditing The
Me.trePCM_Process.SelectedNode.BeginEdit()
I am writing an application in VB.NET that utilizes a treeview. I want to allow my users to add new nodes to the treeview
In my code, I dimension a treenode and set the tree node text to "Type New Process Category Name.
I then set the treeview LabelEdit property to True and call the BeginEdit method
Everything works fine, but before the user can edit the treenode data, he or she must first click on the treenode to activate the edit mode
How can I provide this click event for my customer, so he or she does not have to click on the node first. I would like my customer to just begin typing without requiring them to click on the node. Is this possible
A snippet of my code is below. I appreciate any feedback or suggestions
Best regards
Ma
Dim intSelectedTreeNode As Integer = -
Dim tn As New TreeNod
tn.Text = "Type New Process Category Name
If Me.trePCM_Process.SelectedNode Is Nothing The
Me.trePCM_Process.Nodes.Insert(0, tn
Els
intSelectedTreeNode = Me.trePCM_Process.SelectedNode.Inde
Me.trePCM_Process.Nodes.Insert((intSelectedTreeNode + 1), tn
End I
'-- Now select the newly inserted node
Me.trePCM_Process.SelectedNode = t
Me.trePCM_Process.LabelEdit = Tru
If Not Me.trePCM_Process.SelectedNode.IsEditing The
Me.trePCM_Process.SelectedNode.BeginEdit()