VB 6.0 treeview control "How to make different nodes unvisible"

With the
 Set nod = .Nodes.Add(, , "key", "describtion")

I set different nodes for a treeview.
The tree I set when I load up the form.
Now my question:

When the user performs a certain comand I would like that
all items in nod 1 and all his children dissappear.

I tried
.Nodes("key").visible = false
but it comes up with an error message
"property read only"

What do I have to programme???
themrocAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
DabasConnect With a Mentor Commented:
Easiest way in my opinion is to clear the whole tree, and recreated it without the node.

You could keep a hidden tree or a tree like collection to duplicate your data while you are reconstructing it.

Dabas
0
 
fluglashCommented:
do you want to clear tree or do you want to hide all the nodes?
0
 
themrocAuthor Commented:
I would like to hide only one nod with all its children.
is it possible to do at run time???
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
bob_onlineCommented:
No, you have to remove the nodes...
0
 
MariuszKCommented:
Here is a solution that may work for you:

Get new node
Retain all needed properties of older node (index, releative, parrents, key, etc.)
Delete older node
When you want to display it back the old node insert new node to the tree based on older's node properties that you retained.

Hope this helps you a little bit.
0
 
themrocAuthor Commented:
A little bit confusing,

how do I get a new node, is it the set node methode?

How do I retain all the needed properties?

do you have some coding?
0
 
DanRollinsCommented:
Hi themroc,
It appears that you have forgotten to close this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Accept Dabas's comment(s) as an answer.

themroc, if you think your question was not answered at all or if you need help, just post a new comment here; Community Support will help you.  DO NOT accept THIS comment as an answer.

EXPERTS: If you disagree with that recommendation, please post an explanatory comment.
==========
DanRollins -- EE database cleanup volunteer
0
All Courses

From novice to tech pro — start learning today.