如何在虚拟字符串树节点上添加颜色?

发布于 2024-09-12 13:29:00 字数 326 浏览 0 评论 0原文

虚拟字符串树有可能是这样的吗?

替代文本 http://sphotos.ak.fbcdn。 net/hphotos-ak-ash2/hs142.ash2/40454_1457947221163_1607860397_31141943_5530616_n.jpg

我真的需要帮助,因为我是delphi新手..

Is it possible for a virtual string tree to look like this?

alt text http://sphotos.ak.fbcdn.net/hphotos-ak-ash2/hs142.ash2/40454_1457947221163_1607860397_31141943_5530616_n.jpg

i really need help on this since i'm new in delphi..

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

你没皮卡萌 2024-09-19 13:29:00

您可以在 OnBeforeCellPaint 事件中添加一些内容。例如:

procedure TForm1.VirtualStringTree1BeforeCellPaint(Sender: TBaseVirtualTree;      
    TargetCanvas: TCanvas; Node: PVirtualNode;
    Column: TColumnIndex; CellPaintMode: TVTCellPaintMode; CellRect: TRect; 
var     
  ContentRect: TRect);
begin
  CellRect.Left := CellRect.Left + 20;
  TargetCanvas.Brush.Color := clLime;
  TargetCanvas.RoundRect(CellRect, 5, 5);
  InflateRect(ContentRect, -1, -1);
end;

会给你一个图片中的粗略近似值...

N@

You can put something in then OnBeforeCellPaint event. For instance:

procedure TForm1.VirtualStringTree1BeforeCellPaint(Sender: TBaseVirtualTree;      
    TargetCanvas: TCanvas; Node: PVirtualNode;
    Column: TColumnIndex; CellPaintMode: TVTCellPaintMode; CellRect: TRect; 
var     
  ContentRect: TRect);
begin
  CellRect.Left := CellRect.Left + 20;
  TargetCanvas.Brush.Color := clLime;
  TargetCanvas.RoundRect(CellRect, 5, 5);
  InflateRect(ContentRect, -1, -1);
end;

Would give you a crude approximation of what you have in the picture...

N@

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文