-
Hello!
I've been wondering that is it possible to set a text color of a node in treeview list? I have a treeview in my project and I need to color some nodes with black and some with blue?
Does anyone have a some kind of a code snippet about this?
Thanks,
- Ville
[email protected]
-
Hi Skyline:
Yes it's posible to set a text color of a node.
You can use some code like this:
'Treeview1.Nodes([index node]).ForeColor = vbBlue'
You can get the index number of a node in the 'NodeClick' event in the 'TreeView' object with:
'MyNode = Node.Index', then use this 'MyNode' value in the [index node] and ready. Then you can create a procedure with a 'For Next' to select the nodes that you need to change the color or font.
I hope this can help you.
Regards.
-
Hello there!
I'm sorry but it didn't help me. :( I tried the code:
TreeView1.Nodes(0).ForeColor = vbBlue
But I'll get an error "Method or data member not found" and text ".ForeColor = " was selected.
I have VB5.0 Enterprise Edition.
- Ville
-
Sorry Skyline...
I thought that you were using Vb 6.0, for vb5 componentes you need to use API calls, maybe Aaron Young can help you he's an expert en API's.
Sorry Again
Regards.
-
VBAccelerator.com
Hi there, take a look at http://www.VBAccelerator.com
it has *many* cool controls/code/tips so take a look at the TreeView Component and don't forget to download the SSubtmr.DLL and any other neccesary components, but all of these are very small and at least smaller then the Common Controls.
If you don't want to use this you can use the Common Controls 6. If you don't have it you can mail me, I got them from kedaman