How to tell when the mouse has moved outside the bounds of a Control
Posted on 2001-09-12
I've been trying to write a small program that uses a THintWindow to show a hint when the mouse is over a ListBox. I already have the code for showing the hint when the mouse is over the ListBox but I am having problem with clearing the hint once the mouse moves outside the Listbox. When the hint is displayed, I start a timer and when the OnTimer event is fired, I call the THintWindow.ReleaseHandle which clears the hint for me.
I can hear you all asking, but why am I not using the Application Hint? Well, the Application Hint calls GetShortHint() which breaks up the hint when it reaches a binary OR symbol "|" and seeing how I want to display this symbol in the hint, I can't use the Applications Hint. By displaying the Hint using a THintWindow, I can display anything I want.
Now, back to my problem. Is there a way of determining when the mouse moves outside the bounds of the ListBox? If I can work out when the mouse has moved outside the bounds, then I can call THintWindow.ReleaseHandle to clear the hint.
If anyone can think of a better way of displaying the hint then please let me know.