Page 1 of 1

how to mange event MouseLeave

Posted: Thu May 02, 2019 1:35 pm
by jdm1977
HEllo
i got a question.
How can i properly mange event MouseLeave on my form , and exclude any buttons on form or any other controls
The goal is when i leave a form it should change height , but unfortunatley it also change height when i try to press a button :)

any tip?

thx in advnce...

Re: how to mange event MouseLeave

Posted: Thu May 02, 2019 2:54 pm
by jvierra
Not sure what you are asking or what the issue is. The MouseLeave event fires any time the mouse is not over the control.

Her eis the docs for the event: https://docs.microsoft.com/en-us/dotnet ... mework-4.8

There is no MouseLeave that works for the whole form. You can tie a single event block to all controls so that leaving any control will fire the event.

Re: how to mange event MouseLeave

Posted: Sun May 05, 2019 8:20 pm
by jdm1977
"The MouseLeave event fires any time the mouse is not over the control."

Exactly so when i hover any button on my form The mouseLeave is trigerred and i wish to avoid it... but dont't know how.. ....yet :)

Re: how to mange event MouseLeave

Posted: Mon May 06, 2019 3:30 am
by jvierra
No. The mouse leave event fires after the MouseEnter has fired on a control and fires once when the mouse moves off the control.
To avoid MouseLeave just don't define an event.