I've set the 'mouse leave' event on a windows form and I want to hide the form when the mouse leaves the visible area.
But here is where I am facing a problem. Even when I move the mouse to a button on the same form, it calls the 'mouse leave' event, which makes this form invisible.
It means I've got to prevent the event triggering when moving the mouse to the button. But how? Any other approach?
There is no simple way to do it. One way could be to check all the controls inside the Form and if mouse is not over any of them this means mouse is outside the Form
Another way could be to check inside mouse leave event whether mouse is inside the window boundary or not
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With