如何使一个树节点不可见? (C#)节点

2023-09-03 05:25:08 作者:薄心

有可能是一个非常简单的答案,这一点,但我很难找到它。

There is probably a really straightforward answer to this but I'm having difficulty finding it.

很简单,我有一个树节点,我想做出自己的知名度假的。 (或要显示不允许它的另一种方式,直到需要)。

Simple, I have a TreeNode and I would like to make its visibility false. (or another way of not allowing it to be shown until required).

修改 - ?另一个问题

我很困惑,怎么没有一个可见的属性,但再有就是属性:

I'm confused as to how there isn't a Visible attribute but then there is the property:

Node.PrevVisibleNode;

这之间的区别是什么节点。prevNode

谢谢

推荐答案

我不认为你可以做到这一点。有一个可见性属性,但它是只读的,并表示该节点是否是目前树视图的工作区中可见控制。我想你会需要从它所在的节点集合中删除它(和可选记得它的位置,以便能够恢复它。

I don't think you can do that. There is an IsVisible property, but it is readonly and will indicate whether the node is currently visible within the client area of the TreeView control. I think you will need to remove it from the nodes collection in which it resides (and optionally remember the position of it to be able to restore it.