按路径选择树视图节点 [英] Select a treeview node by its path

查看:53
本文介绍了按路径选择树视图节点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好。

我知道您可以查看节点的完整路径属性,但是可以使用其路径选择

a节点吗?

比如,告诉树视图应该选择的节点是节点

,路径为Users\Administrators\John Doe?

提前谢谢!


Andre Nogueira

Hi there.
I know you can view a node''s fullpath property, but is it posible to select
a node using its path?
Like, tell the treeview that the node that should be selected is the node
with the path "Users\Administrators\John Doe"?
Thank you in advance!

Andre Nogueira

推荐答案

*"AndréNogueira" <一个** @ netcabo.pt.NOSPAM> scripsit:
* "André Nogueira" <an**@netcabo.pt.NOSPAM> scripsit:
我知道你可以查看节点的fullpath属性,但是可以使用它的路径选择一个节点吗?
就像告诉treeview一样应该选择的节点是具有路径Users\Administrators\John Doe的节点?
I know you can view a node''s fullpath property, but is it posible to select
a node using its path?
Like, tell the treeview that the node that should be selected is the node
with the path "Users\Administrators\John Doe"?




设置存储的哈希表( fullpath,''TreeNode'')配对。那么你

可以通过路径查找treenodes,并将树视图'

''SelectedNode''属性设置为特定节点。

-

MS Herfried K. Wagner

MVP< URL:http://dotnet.mvps.org/>

VB< URL:http://dotnet.mvps.org/dotnet/faqs/>



Set up a hashtable that stores (fullpath, ''TreeNode'') pairs. Then you
can lookup the treenodes by their path and set the treeview''s
''SelectedNode'' property to the specific node.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>


谢谢!

我之前从未使用哈希表,但我会查看它。


Andre Nogueira


" Herfried K. Wagner [ MVP] QUOT; <喜*************** @ gmx.at>在消息中写道

news:呃************** @ tk2msftngp13.phx.gbl ...
Thanks!
I''ve never used hashtables before, but I''ll look it up.

Andre Nogueira

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:uh**************@tk2msftngp13.phx.gbl...
*"AndréNogueira" ; <一个** @ netcabo.pt.NOSPAM> scripsit:
* "André Nogueira" <an**@netcabo.pt.NOSPAM> scripsit:
我知道你可以查看一个节点的fullpath属性,但它是否可以使用它的路径选择一个节点?
就像,告诉树视图,应该选择的节点是路径为Users\Administrators\John Doe的节点?
I know you can view a node''s fullpath property, but is it posible to
select
a node using its path?
Like, tell the treeview that the node that should be selected is the node
with the path "Users\Administrators\John Doe"?



设置存储的哈希表( fullpath,''TreeNode'')配对。然后你可以按路径查找treenodes,并将树视图'
''SelectedNode''属性设置为特定节点。

-
MS Herfried K. Wagner
MVP< URL:http://dotnet.mvps.org/>
VB< URL:http://dotnet.mvps.org/dotnet/faqs/>



Set up a hashtable that stores (fullpath, ''TreeNode'') pairs. Then you
can lookup the treenodes by their path and set the treeview''s
''SelectedNode'' property to the specific node.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>



像魅力一样工作!

再次感谢你,因为你有时间和耐心需要

来帮助我!

你真的应该得到MVP身份以及像你一样的人能够像我一样拯救

生命=)

$ b $bAndréNogueira


" Herfried K. Wagner [MVP]" <喜*************** @ gmx.at>在消息中写道

news:呃************** @ tk2msftngp13.phx.gbl ...
Worked like a charm!
Thank you once more for all the times you had the time and patience needed
to help me out!
You really deserve the MVP status and its people like you that save the
lifes of people like me =)

André Nogueira

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:uh**************@tk2msftngp13.phx.gbl...
*"AndréNogueira" ; <一个** @ netcabo.pt.NOSPAM> scripsit:
* "André Nogueira" <an**@netcabo.pt.NOSPAM> scripsit:
我知道你可以查看一个节点的fullpath属性,但它是否可以使用它的路径选择一个节点?
就像,告诉树视图,应该选择的节点是路径为Users\Administrators\John Doe的节点?
I know you can view a node''s fullpath property, but is it posible to
select
a node using its path?
Like, tell the treeview that the node that should be selected is the node
with the path "Users\Administrators\John Doe"?



设置存储的哈希表( fullpath,''TreeNode'')配对。然后你可以按路径查找treenodes,并将树视图'
''SelectedNode''属性设置为特定节点。

-
MS Herfried K. Wagner
MVP< URL:http://dotnet.mvps.org/>
VB< URL:http://dotnet.mvps.org/dotnet/faqs/>



Set up a hashtable that stores (fullpath, ''TreeNode'') pairs. Then you
can lookup the treenodes by their path and set the treeview''s
''SelectedNode'' property to the specific node.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>



这篇关于按路径选择树视图节点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆