MouseEnter and MouseExit when RectControl moves

Hi all. I have a situation (desktop app) where I process MouseEnter and MouseExit when the mouse moves over a textArea. When the mouse enters the TextArea, the TextArea expands to show the entire text content for the user to read and edit. I also make the TextArea expand in height as the user enters more text. When the mouse leaves, the TextArea drops back to its default height. So far, so good.

Problem is: If the user edits the text to remove text, my TextArea shrinks with the text, and sometimes shrinks smaller than where the mouse is located. The mouse has certainly left the TextaArea but because the TextArea has shrunk, not because the mouse has moved. The MouseExit is never triggered, so the TextArea never resets to its small height.

Any ideas how to trigger a MouseExit event when the RectControl moves away from under the mouse?

You could use the MouseMove event of the TA to detect when the mouse leaves the TextArea. Use a single timer which Action event will be the mouseExit, with this in the MouseMove event :

TimerExit.Mode = Timer.ModeOff TimerExit.Mode = Timer.ModeSingle

A period of 250 should suffice so when the mouse quits the TextArea, the timer fires and you do what you need in the Action event.