views:

108

answers:

3

I want to show a string like this as a note's text:

Name: John

It has a bold part and a regular one. Is there a way that I can do this?

+1  A: 

You have to use owner-drawing. Have a look at the On*CustomDraw* events.

Ulrich Gerhardt
+7  A: 

Yes, using custom drawing (OnCustomDraw, OnCustomDrawItem events). Have a look at the CustomDraw demo that comes with Delphi. It demonstrates a custom-drawn treeview.

TOndrej
+2  A: 

You can use custom draw, yes, but this is not always handy. I can recommend looking at LMD ElPack (), namely their ElTree class. That class lets you use mini-HTML in nodes and optionally in secondary cells (ElTree is a TreeList control).

Eugene Mayevski 'EldoS Corp
Hi @Eugene. Nice to see you here at SO. I bought ElPack from you many years ago, and I'm still using ElPack and ElTree (now ElXTree) in my application. It's a nice class. I've been tempted, but never had a need to move to VirtualTreeView, since ElTree has a Virtual mode of its own and does everything I need of it. LMD has been supporting it and producing new versions since they purchased it from you.
lkessler
@lkessler thank you for your kind words :)
Eugene Mayevski 'EldoS Corp