Recent

Author Topic: treenode font style  (Read 221 times)

fcu

  • Jr. Member
  • **
  • Posts: 80
treenode font style
« on: November 22, 2022, 04:16:32 pm »
Hi
how can i change a treenode font style , make it bold for example
like in the picture

jamie

  • Hero Member
  • *****
  • Posts: 5045
Re: treenode font style
« Reply #1 on: November 23, 2022, 12:11:23 am »
Code: Pascal  [Select][+][-]
  1.  
  2. procedure TForm1.TreeView1CustomDrawItem(Sender: TCustomTreeView;
  3.   Node: TTreeNode; State: TCustomDrawState; var DefaultDraw: Boolean);
  4. begin
  5.  With TTreeView(Sender) do
  6.    Begin
  7.      If Node.Parent = Nil Then
  8.        Begin
  9.         font.color := clBlack;
  10.        end
  11.      else
  12.    Font.Color := clgray;
  13.    end;
  14. end;                      
  15.  

Set the NoThemeDraw to off in the Options of the Treeview.
The only true wisdom is knowing you know nothing

fcu

  • Jr. Member
  • **
  • Posts: 80
Re: treenode font style
« Reply #2 on: November 23, 2022, 07:12:12 am »
thanks jamie

 

TinyPortal © 2005-2018