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.
LVL 5
Tom KnowltonWeb developerAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.