如何清除 TreeView 中选定节点的选择? [英] How do I clear the selection of a selected node in a TreeView?

查看:38
本文介绍了如何清除 TreeView 中选定节点的选择?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何取消选中节点(在选择事件之后)?

How to deselect selected node (in after select event)?

推荐答案

当你遇到这样的问题时(处理需要使用什么api)你应该咨询MSDN然后想办法出来.

When you are faced with issues like this (dealing with what api you need to use) You should consult MSDN and then figure it out.

现在,请参阅 msdn 上的 TreeView 页面.它有一个 Selectednode 属性,它说:

Now, see the TreeView page on msdn. It has a Selectednode property which says :

如果当前未选择 TreeNode,则 SelectedNode 属性为 null.

If no TreeNode is currently selected, the SelectedNode property is null.

此外,它还有一个 gettersetter.所以我最好的选择是:

Also, it has a getter and setter. So my best bet is:

myTreeView.SelectedNode = null;//will deselect it

这篇关于如何清除 TreeView 中选定节点的选择?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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