Change TreeNode text color

Change TreeNode text color

Post by Greg Stant » Sun, 05 Oct 2003 14:30:04


This is a tough one, but i could swear i had a snippet for it,
somehow i can't seem to find it at all. I have a tree, according to
what the specific node is pointing to at the time, i want to make
that node bold. I guess to make a long story short, how do you
make a single node bold, while the rest of the nodes stay at
normal font?


Greg
 
 
 

Change TreeNode text color

Post by Team » Sun, 05 Oct 2003 16:03:55


You need to use the OnCustomDrawItem or OnAdvancedCustomDrawItem event,
manipulating the TreeView's Canvas as needed on a per-node basis. You can
use the TTreeNode::Data property to store custom data per node which you can
retreive in the event handler to help you decide how to draw the particular
Node being drawn at the time.


Gambit