开发者

Delphi TreeView: Can I have different styles in one node's text?

开发者 https://www.devze.com 2023-01-21 05:48 出处:网络
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?Yes, using custom drawing (OnCustomDraw, OnCu

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?


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


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).


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

0

精彩评论

暂无评论...
验证码 换一张
取 消