具有动态树节点的递归函数
我有一个递归函数,其目标是扫描一个结构并用树节点表示该结构。
我的函数内部取决于结构,我必须在我的树节点内创建另一个树节点,或者只创建一个节点。
我的问题是,当我必须再次调用我的函数时,我不知道如何记住我的树节点位置。
If strTop.TextString.ToUpper = "DMN" Then
gcTreeno.Nodes.Add("Node")
Else
Dim perf As New TreeNode
gcTreeno.Nodes.Add(perf)
End If
如果我想下次将节点写入 perf,我该怎么做?
I have a recursive function wich objective is scann an structure and represent that structure with treenodes.
Inside my function depends the structure I'll have to create another treenode inside my treenode or just create a node.
My problem is that I don't know how to remember my treenode position when I have to call my function again.
If strTop.TextString.ToUpper = "DMN" Then
gcTreeno.Nodes.Add("Node")
Else
Dim perf As New TreeNode
gcTreeno.Nodes.Add(perf)
End If
if i would like to write next time a node into perf, how i could do it ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
只需检查其他功能..您可以将键值传递给您的节点。
就像 gcTreeno.Nodes.Add("key", "text")
Just check the other functions .. you can pass a Key Value to your node.
like
gcTreeno.Nodes.Add("key", "text")