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

Posted on 2003-03-04
Medium Priority
Last Modified: 2010-04-07
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???
Question by:themroc
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Expert Comment

ID: 8065665
do you want to clear tree or do you want to hide all the nodes?

Author Comment

ID: 8065759
I would like to hide only one nod with all its children.
is it possible to do at run time???

Expert Comment

ID: 8066036
No, you have to remove the nodes...

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.


Expert Comment

ID: 8066059
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.

Author Comment

ID: 8066821
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?
LVL 27

Accepted Solution

Dabas earned 440 total points
ID: 8066918
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.

LVL 49

Expert Comment

ID: 9046778
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

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses
Course of the Month14 days, 4 hours left to enroll

801 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question