English 中文(简体)
How to get hot node coords of TVirtualStringTree?
原标题:

I m trying to paint VirtualStringTree s cell differently when mouse is over it. How can I detect the coords of hot node? I know there s a HotNode property but it returns only Node that is under mouse cursor. I need to get cell coords (X,Y) of that node.

最佳回答

You can get the coordinates of any node with the GetDisplayRect method. Also, InvalidateNode will tell you the coordinates of the node you just invalidated.

For your purposes, I don t think you need to know the coordinates of any arbitrary node, though. Instead, you need to know, when you re painting the node, whether the node you re painting is the hot one. All the node-specific owner-draw events tell you both the current node and the coordinates, except for OnPaintText, which only tells you the node. There s no need to track the current hot node yourself, though. Just check whether Node = Sender.HotNode to determine what style to use for painting the node and its text.

You might be able to avoid the whole issue, though. The control has a fair amount of hot-node-specific code already, so it might just be a matter of finding what properties to configure instead of having to paint everything yourself.

问题回答

暂无回答




相关问题
determining the character set to use

my delphi 2009 app has a basic translation system that uses GNUGetText. i had used some win API calls to prepare the fonts. i thought it was working correctly until recently when someone from Malta ...

Help with strange Delphi 5 IDE problems

Ok, I m going nuts here. For the last (almost) four years, I ve been putting up with some extremely bad behavior from my Delphi 5 IDE. Problems include: Seemingly random errors in coride50.bpl ...

How to write a Remote DataModule to run on a linux server?

i would like to know if there are any solution to do this. Does anyone? The big picture: I want to access data over the web, using my delphi thin clients. But i´would like to keep my server/service ...

How convert string to integer in Oxygene

In Delphi, there is a function StrToInt() that converts a string to an integer value; there is also IntToStr(), which does the reverse. These functions doesn t appear to be part of Oxygene, and I can ...

Quick padding of a string in Delphi

I was trying to speed up a certain routine in an application, and my profiler, AQTime, identified one method in particular as a bottleneck. The method has been with us for years, and is part of a "...

热门标签