TDBTree - change font color based upon database field value?

TeeTree VCL for Borland Delphi and C++ Builder.
Post Reply
DbTree_User123
Newbie
Newbie
Posts: 3
Joined: Mon May 05, 2003 4:00 am

TDBTree - change font color based upon database field value?

Post by DbTree_User123 » Thu Oct 06, 2011 5:08 pm

Hello,

TDBTree has properties for CodeField and ParentField, which gives a nice hierarchical display. I would like to be able to control the tree item text color that is displayed depending on the value of a database field.

The value of the database field would determine in which color the tree item text would be displayed. I would like the tree item text displayed in blue at the end of the tree (lowest level of the tree).

DBTree1.Color := clred; -- i tried this code but it colors the tree background in red and not individual tree items

I am hoping that the DBTree component is able to do this, and I cannot find it in the help file.
Could you please provide some sample code for me on how to implement this.
If this is not implemented please consider this a feature request.

Thank you in advance,

Erik

Yeray
Site Admin
Site Admin
Posts: 9622
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: TDBTree - change font color based upon database field value?

Post by Yeray » Tue Oct 11, 2011 11:20 am

Hello Erik,

Excuse us for the delayed reply here.

You can format each shape as in the example at "What's New ?\Welcome !\Nodes\Format\Font" in the TeeTree demo included with the installation. Isn't it what you are trying to achieve? For example:

Code: Select all

Tree1.Shape[0].Font.Color:=clRed;
Tree1.Shape[1].Color:=clGreen;
If you still have problems with it, please try to arrange a simple example project we can run as-is to reproduce the problem here.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply