How to make TreeNode invisible? (WITH#)

There is probably a very simple answer to this question, but it's hard for me to find it.

Simple, I have a TreeNode, and I would like to make its visibility false. (or another way not to show it until needed).

Change - another question?

I am confused by the fact that there is no Visible attribute, but then there is a property:

Node.PrevVisibleNode; 

What is the difference between this and Node.PrevNode ?

Thanks,

+4
source share
4 answers

I do not think you can do this. There is an IsVisible property, but it is read-only and will indicate whether the node is displayed in the client area of ​​the TreeView control. I think you will need to remove it from the collection of nodes in which it is located (and, if desired, remember its position in order to restore it.

+3
source

Hmm ... I originally (and incorrectly) mentioned IsVisible . However, when checking out, I expect the answer to be simple: do not add it until you need it.

It is easier if your user interface model is an abstraction over your real data model, so you can store elements in the data model regardless of their visibility and simply update the UI (add / remove / update nodes) as needed.

+2
source

I do not think you can. You will need to remove the node.

0
source

Node.PrevVisibleNode;

I think this means visible, as visible to the user in it (all parent nodes are extended)

-1
source

All Articles