by Ben Cather (1 Submission)
Category: Custom Controls/Forms/Menus
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Mon 7th October 2002
Date Added: Mon 8th February 2021
Rating:
(1 Votes)
This function is specific for a TreeView control. It will return a specific node's subsequent nodes according to the TreeView. It will return
API Declarations
'2.name of the specific node
'3.index # of the specific node
Function T_GetChildren(TreeView As TreeView, cStart As String, i As Integer) As String
Dim cResult As String
Dim cParent As String
On Error GoTo GetChildren_Err
Do
If TreeView.Nodes(i).Children > 0 And cParent <> TreeView.Nodes(i).Text Then
cParent = TreeView.Nodes(i).Text
i = TreeView.Nodes(i).Child.Index
Else
cResult = cResult & "'" & TreeView.Nodes(i).Text & "',"
If TreeView.Nodes(i) <> TreeView.Nodes(i).LastSibling Then
cParent = TreeView.Nodes(i).Parent.Text
i = TreeView.Nodes(i).Next.Index
Else
cParent = TreeView.Nodes(i).Parent.Text
i = TreeView.Nodes(i).Parent.Index
End If
End If
Loop While cStart <> TreeView.Nodes(i).Text
cResult = "(" & cResult & "'" & cStart & "')"
T_GetChildren = cResult
GetChildren_Err:
Select Case Err
Case 91
T_GetChildren = "('" & cStart & "')"
End Select
End Function
No comments have been posted about This function is specific for a TreeView control. It will return a specific node's subsequent nodes. Why not be the first to post a comment about This function is specific for a TreeView control. It will return a specific node's subsequent nodes.