Try someting like this
[code lang=”delphi”]///////////////////////
uses COMMCTRL;
const
TVM_SETBKCOLOR = (TV_FIRST + 29);
TVM_SETTEXTCOLOR = (TV_FIRST + 30);
//////////////////////////////////////
—————————————————————————-
—————————-
var
AColor : TColor;
AColor := MyTreeView.Color;
if (AColor and $80000000) <> 0 then // system color index NOT RGB !
AColor := GetSysColor(AColor and $00FFFFFF);
if MyTreeView.Images.BkColor <> MyTreeView.Color then
MyTreeView.Images.BkColor := AColor;
SendMessage(MyTreeView.Handle, TVM_SETBKCOLOR, 0, AColor);
—————————————————————————-
——————————-
[/code]
This was not compiled ! But I know it works (from one of my own programs)
Brilliant, Works perfect. Just what I was after..
[tags]Delphi, Components, TreeView[/tags]
0 Kommentare zu “TreeView Background color: Textcolor”