Color of Nodes in a treeview 
Author Message
 Color of Nodes in a treeview

How do I change the color of an individual Node in a treeview?


Mon, 23 Jul 2001 03:00:00 GMT  
 Color of Nodes in a treeview
David, I guess it all depends on what version of MS Common Controls you
have.

If you have VB6 (MS Common Controls Version 6.0) you can try:

Dim i As Integer
Dim nod_x As Node

For i = 1 To 25
Set nod_x = TreeView1.Nodes.Add(, , , "This is a sample node: " & i)
nod_x.ForeColor = QBColor(Int((15 * Rnd) + 1))   ' Generate random value
between 1 and 15.
Next

If you have MS Common Controls 5.0 (SP2):

Check out the following link:

VBNet:

Code Library | Common Ctrls | TreeView | Applying Special Effects to a
Treeview via API

http://www.mvps.org/vbnet/

hth
galen



Quote:
>How do I change the color of an individual Node in a treeview?



Mon, 23 Jul 2001 03:00:00 GMT  
 Color of Nodes in a treeview
Hi David,
        If you want to change the color of the bitmap associated with the
node, use a different image in the imagelist and load it at runtime when
creating the nodes of the tree.
        Or if you want to change the background color of the text in the
node, then we can use the SendMessage, GetWindowLong and SetWindowLong
window APIs. Set the TVM_SETBKCOLOR in the SendMessage call to red.
Hope this helps you.

Rgds,
Babu.


Quote:
>How do I change the color of an individual Node in a treeview?



Wed, 25 Jul 2001 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Can treeview nodes change color?

2. Treeview node color

3. HOW TO: set color of nodes in TreeView

4. change treeview selected node color

5. Different colors for Treeview nodes?

6. Changing the Color of a Treeview Node

7. HOW TO: set color of nodes in TreeView

8. TreeView : How to set a different color to node's Caption

9. Node Text Color in Treeview Control

10. TreeView Nodes With Multiple Colors

11. TreeView : How to set a different color to node's Caption

12. TreeView Specific Node Color

 

 
Powered by phpBB® Forum Software