如何重新选择刚刚选择的同一树视图节点 [英] How do I re-select the same treeview nodeagain that was just selected
问题描述
我有一个用户选择了一个树视图节点的应用程序,然后代码只显示在列表框中的所有jpg,(这个应用程序还做了许多其他的事情,所以这个代码必须保留)但是我想要一个功能添加到程序中,当选择某个按钮时,它将(仅适用于此occaision更改扩展名)。所以我需要知道如何重新选择相同的节点并显示一组具有不同扩展名的新文件。
所以我怎么说
变量= treeview.selectedindex
Treeview.selectednode =无
Treeview.selectednode =变量
感谢您的帮助
我的尝试:
我看过的建议解决方案似乎没有回答这个问题
I have an app that the user selects a treeview node, the code then displays in a list box all jpg only, (this app also does many other things so this code has to stay) but there is one feature I want to add to the program that when a certain button is selected it will (just for this occaision change the extension). So I need to know how to re-select the same node and display a new set of files with a different extension.
so how do I say
Variable = treeview.selectedindex
Treeview.selectednode = nothing
Treeview.selectednode = variable
Thanks for any help
What I have tried:
suggested solutions I have looked at do not seem to answer this question
推荐答案
你必须使用TreeView.SelectedNode Property(System.Windows.Forms) [ ^ ]
You have to use TreeView.SelectedNode Property (System.Windows.Forms)[^]
Dim sn As TreeNode = TreeView1.SelectedNode
'...
'later:
TreeView1.SelectedNode = sn
这篇关于如何重新选择刚刚选择的同一树视图节点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!