Click to See Complete Forum and Search --> : Hide nodes in TreeView


J@IBO
February 22nd, 2000, 12:49 PM
How can I hide some nodes in a TreeView???

-----> JAFET

Johnny101
February 22nd, 2000, 02:27 PM
Isn't there a .visible property you can use?

John Pirkey
MCSD
www.ShallowWaterSystems.com

J@IBO
February 22nd, 2000, 02:39 PM
Yes.. but It's Read Only...

I try it and VB send me:

Error '383' At Runtime
Read Only Property

-----> JAFET

Chris Eastwood
February 22nd, 2000, 03:22 PM
You can't do this with the standard TreeView control that comes with VB5 / VB6. You'd have to get into some low-level subclassing to handle the custom-drawing of the nodes (ignoring the ones you want to hide).

It's a lot of work - I posted some code to the CG site over a year ago that handled painting each node a different colour (for VB5 - I know you can do it now with VB6)

Can't you just choose not to add those nodes to the tree ? or simply remove the ones from the tree you don't want shown and add them in when required ?

Chris Eastwood

CodeGuru - the website for developers
http://codeguru.developer.com/vb