• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 183
  • Last Modified:

TTreeView - changing text from Normal to Bold.

Is there a way to change the text style from Normal to Bold when I click on a Node in a TTreeView?  Some code would be helpful.

Thanks.
0
Tom Knowlton
Asked:
Tom Knowlton
  • 2
  • 2
1 Solution
 
intheCommented:
ownerdrawn like:

procedure TForm1.TreeView1CustomDrawItem(Sender: TCustomTreeView;
  Node: TTreeNode; State: TCustomDrawState; var DefaultDraw: Boolean);
begin
 if  Node.Selected then
 with node do
  begin
    TreeView1.Canvas.Font.Name := 'Courier New';
    TreeView1.Canvas.Font.Color := clRed;
    TreeView1.Canvas.Font.size :=  12;
    TreeView1.Canvas.Font.style := [fsbold];
  end
  else begin
    TreeView1.Canvas.Font.Name := 'Arial';
    TreeView1.Canvas.Font.Color := clGreen;
    TreeView1.Canvas.Font.size :=  8;
    TreeView1.Canvas.Font.style := [fsitalic];
  end;
end;

Regards :-)
0
 
LischkeCommented:
All built-in in TreeNT :-)

Ciao, Mike
0
 
intheCommented:
hi mike ,
last night we have much fun with treeview's ;-)

see also:
http://www.experts-exchange.com/jsp/qShow.jsp?ta=delphi&qid=10235489 

you know about these things so if i got anything wrong please say ,as it was all new to me
cheers
0
 
LischkeCommented:
It *is* fun :-) Currently I'm working on my virtual tree view and I enjoy it very much...

Ciao, Mike
0
 
Tom KnowltonWeb developerAuthor Commented:
I trust this works.

I think I may be going a different direction, so I probably won't be using this, but thanks.

Tom
0

Featured Post

Take Control of Web Hosting For Your Clients

As a web developer or IT admin, successfully managing multiple client accounts can be challenging. In this webinar we will look at the tools provided by Media Temple and Plesk to make managing your clients’ hosting easier.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now