Delphi:树视图的自定义提示
有没有一种快速的方法来为树视图项目的 5 个子项目创建 5 个自定义提示?
我有 TreeView、1 个项目和 5 个子项目。我需要每个子项的特殊提示(第一个子项 - “F1”,第二个 - “F2” 等等)。
我无法将此应用于我的目的: http://delphi.about.com/ od/vclusing/a/treenode_hint.htm?
Is there a fast way to create 5 custom hints for 5 SubItems of Item of Tree View?
I have TreeView, 1 Item and 5 SubItems. I need a special hint for each SubItem (for first one - "F1", second one -"F2" and so on).
I can not apply this to my purpose: http://delphi.about.com/od/vclusing/a/treenode_hint.htm?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
听起来您只想要
OnHint
事件:有时此方法可能有点粗糙,并提供一个您没有明显将鼠标悬停在其上的
Node
。如果您想要更多控制,可以使用GetNodeAt
和GetHitTestInfoAt
:THitTests
的定义如下:如您所见,这为您提供了很多对显示提示的时间和内容进行细粒度控制。
It sounds like you just want the
OnHint
event:Sometimes this method can be a bit crude and offer up a
Node
that you aren't obviously hovering over. If you want more control you can useGetNodeAt
andGetHitTestInfoAt
:The definition of
THitTests
is as follows:As you can see this gives you a lot of fine grained control over when and what you show as a hint.
我会设置组件的提示来响应
OnMouseMove
(或者为您提供鼠标坐标的其他事件,您可以从中获取鼠标所在的项目 - 我可能弄错了名称,并且在当我没有德尔福时)。I would set the hint of the component in response to
OnMouseMove
(or that other event that gives you mouse coordinates, from which you can get the item the mouse is over - I might have mistaken the name and at the moment I have no Delphi with me).