Home > Software engineering >  Vs2010 with code add child nodes in a specified node name how to write?
Vs2010 with code add child nodes in a specified node name how to write?

Time:10-04

If inscribe!
The following code is written by others to help me, a part of the code in your 2010 already does not support


Dim (s), ss () As String
Dim L, I, j As Long

Dim s0 As String
Tree1. Nodes. The Clear ()
S=Split (T1) Text, vbCrLf)
For L=0 To UBound (s)
Ss=Split (s (L), "")
If L=0 Then
Tree1. Nodes. The Add (ss (0))
End the If
For I=1 To UBound (ss)
If ss (I) & lt;> "" Then
J=checkvalid (ss) (I)

If j=1 Then
J=checkvalid (ss (j - 1))

S0=Tree1. Nodes (j). The key
Tree1. Nodes. The Add (s0, lvwchild, ss (I))

End the If
End the If
Next
Next
Checkvalid custom code is used to determine whether there is renamed node
How do you write code should be in 2010?

CodePudding user response:

 
Dim RootNode As TreeNode
For Each RootNode In TreeView1. Nodes
If RootNode. Text=ss (I) Then
NODEEXIST=True
End the If
Next


A rough code
  • Related