{"id":99,"date":"2007-05-12T14:05:30","date_gmt":"2007-05-12T12:05:30","guid":{"rendered":" http:\/\/www.nsonic.de\/blog\/2007\/05\/treeview-background-color-textcolor\/"},"modified":"2007-05-12T14:05:31","modified_gmt":"2007-05-12T12:05:31","slug":"treeview-background-color-textcolor","status":"publish","type":"post","link":"https:\/\/www.nsonic.de\/blog\/2007\/05\/treeview-background-color-textcolor\/","title":{"rendered":"TreeView Background color: Textcolor"},"content":{"rendered":"<p>Try someting like this<\/p>\n<p>[code lang=&#8221;delphi&#8221;]\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/<br \/>\nuses COMMCTRL;<\/p>\n<p>const<br \/>\nTVM_SETBKCOLOR = (TV_FIRST + 29);<br \/>\nTVM_SETTEXTCOLOR = (TV_FIRST + 30);<br \/>\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/<\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br \/>\nvar<br \/>\nAColor : TColor;<\/p>\n<p>AColor := MyTreeView.Color;<br \/>\nif (AColor and $80000000) <> 0 then \/\/ system color index NOT RGB !<br \/>\nAColor := GetSysColor(AColor and $00FFFFFF);<br \/>\nif MyTreeView.Images.BkColor <> MyTreeView.Color then<br \/>\nMyTreeView.Images.BkColor := AColor;<br \/>\nSendMessage(MyTreeView.Handle, TVM_SETBKCOLOR, 0, AColor);<\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br \/>\n[\/code]<br \/>\nThis was not compiled !  But I know it works (from one of my own programs)<\/p>\n<p>Brilliant, Works perfect. Just what I was after..<\/p>\n<p>[tags]Delphi, Components, TreeView[\/tags]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Try someting like this [code lang=&#8221;delphi&#8221;]\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ uses COMMCTRL; const TVM_SETBKCOLOR = (TV_FIRST + 29); TVM_SETTEXTCOLOR = (TV_FIRST + 30); \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;- &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;- var&hellip;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":""},"categories":[11],"tags":[90,75,95],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p71Tml-1B","_links":{"self":[{"href":"https:\/\/www.nsonic.de\/blog\/wp-json\/wp\/v2\/posts\/99"}],"collection":[{"href":"https:\/\/www.nsonic.de\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.nsonic.de\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.nsonic.de\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.nsonic.de\/blog\/wp-json\/wp\/v2\/comments?post=99"}],"version-history":[{"count":0,"href":"https:\/\/www.nsonic.de\/blog\/wp-json\/wp\/v2\/posts\/99\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.nsonic.de\/blog\/wp-json\/wp\/v2\/media?parent=99"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.nsonic.de\/blog\/wp-json\/wp\/v2\/categories?post=99"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.nsonic.de\/blog\/wp-json\/wp\/v2\/tags?post=99"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}