怎么实现用代码点击treeview的node
怎么实现用代码点击treeview的node,或者通过代码实现将选中的node呈现在页面中? --------------------编程问答-------------------- 递归 --------------------编程问答-------------------- 不明白楼主的意思,如果是问怎样展示数据为树状结构,需要用到递归函数。 --------------------编程问答-------------------- Treeview.SelectedNode=findnode(treeview1,nothing,"123")Public Function FindNode(ByVal oTv As TreeView, ByVal sNode As TreeNode, ByVal oTag As Object) As TreeNode
Dim oNode As TreeNode
Dim ONodes As TreeNodeCollection
If sNode Is Nothing Then
ONodes = oTv.Nodes
Else
ONodes = sNode.Nodes
End If
For Each oNode In ONodes
If oNode.Tag.Equals(oTag) Then
Return oNode
Else
oNode = FindNode(oTv, oNode, oTag)
If oNode IsNot Nothing Then
Return oNode
End If
End If
Next
Return Nothing
End Function
补充:.NET技术 , VB.NET