On Wed, 01 Sep 2004 15:50:22 +1200, Rohit Gupta <[EMAIL PROTECTED]> wrote:

OnCustomDrawItem of TreeView

I can change the font colors but not the size - any idea why ?

Regards

Rohit


Rohit,

Using a standard TreeView something like this should work:-

procedure TForm1.TreeView1CustomDrawItem(Sender: TCustomTreeView;
 Node: TTreeNode; State: TCustomDrawState; var DefaultDraw: Boolean);
begin
 if Node.Text = 'One' then
 begin
   TreeView1.Canvas.Font.Name := 'Courier New';
   TreeView1.Canvas.Font.Color := clRed;
   TreeView1.Canvas.Font.Size := 10;
 end
 else
 begin
   TreeView1.Canvas.Font.Name := 'MS Sans Serif';
   TreeView1.Canvas.Font.Color := clBlack;
   TreeView1.Canvas.Font.Size := 8;
 end;
end;

but only if the sizes aren't too different because this doesn't change the amount of vertical space actually used to draw the item.

Regards
Kit Jackson

_______________________________________________
Delphi mailing list
[EMAIL PROTECTED]
http://ns3.123.co.nz/mailman/listinfo/delphi

Reply via email to