Board index » delphi » TreeView, selected node, background color change

TreeView, selected node, background color change

Hello:

Thank you for your attention.

Please, do you know how to change the background color of the selected node
of a TreeView?

Thank you in advance for your help.

Kind regards,

Carlos Borrero

 

Re:TreeView, selected node, background color change


Use the OnCustomDrawItem event

procedure TForm1.TreeView1CustomDrawItem(Sender: TCustomTreeView;
  Node: TTreeNode; State: TCustomDrawState; var DefaultDraw: Boolean);
begin
   If Node = Nil Then Exit ;
   If Node.Selected Then Begin
      // Set forground color
      Sender.Canvas.Font.Color := clBlue ;
      // set background color
      Sender.Canvas.Brush.Color := clRed ;
   End;
end;

-Steve-

Quote
"Carlos Borrero" <cbar...@impsat.net.co> wrote in message

news:8vj947$g6a3@bornews.inprise.com...
Hello:

Thank you for your attention.

Please, do you know how to change the background color of the selected node
of a TreeView?

Thank you in advance for your help.

Kind regards,

Carlos Borrero

Other Threads