BCB6 TTreeView
Have need to colour items which I do thus and it works brilliantly...
TreeView1CustomDrawItem(..)
{
HDC hDC = Sender->Canvas->Handle;
TColor fcl = clBlack;
TColor bcl = clWhite;
DefaultDraw = true;
if ( Node->Data != NULL )
{
// modify colours as required
}
if ( State.Contains( cdsFocused ) )
{
fcl = clWhite ;
bcl = bcl & ~0x00808080 ; // darken bcl
}
SetBkColor(hDC, bcl);
SetTextColor(hDC, fcl);
}
(The Focused bit just ensures text remains legible when focused even with otherwise illegible colour combinations.) Only query .. I would like to be able some times to set the Font to Bold. Can't work out how to do that.
I messed around all weekend with variations on Canvas and HDC and OnAdvancedCustomDrawItem but with abject failure!
Thanks in advance ?
Denville.