0% found this document useful (0 votes)
19 views

Funcion RecorrerTreeView

This document describes a recursive function to traverse a tree view control and modify node text. The function loops through each node in a tree node collection, setting the text to "Hijo" for leaf nodes and "Padre" for parent nodes, then recursively calls itself on any child nodes. The example shows calling this function on page load to traverse and modify all nodes in the treeMenu control.

Uploaded by

vicearellano
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views

Funcion RecorrerTreeView

This document describes a recursive function to traverse a tree view control and modify node text. The function loops through each node in a tree node collection, setting the text to "Hijo" for leaf nodes and "Padre" for parent nodes, then recursively calls itself on any child nodes. The example shows calling this function on page load to traverse and modify all nodes in the treeMenu control.

Uploaded by

vicearellano
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 1

Private Sub RecorrerTreeView(ByRef Nodos As TreeNodeCollection)

For Each Nodo As TreeNode In Nodos


If Nodo.ChildNodes.Count = 0 Then
Nodo.Text = "Hijo"
Else
Nodo.Text = "Padre"
RecorrerTreeView(Nodo.ChildNodes)
End If
Next
End Sub

La llamada a la funcin sera

Private Sub Page_Load(ByVal src As Object, ByVal e As EventArgs) Handles MyBase.Init


RecorrerTreeView(treeMenu.Nodes)
end sub

You might also like