how to mange event MouseLeave

Ask questions about creating Graphical User Interfaces (GUI) in PowerShell and using WinForms controls.
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Locked
jdm1977
Posts: 2
Joined: Thu May 02, 2019 8:22 pm

how to mange event MouseLeave

Post by jdm1977 » Thu May 02, 2019 1:35 pm

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...

jvierra
Posts: 13992
Joined: Tue May 22, 2007 9:57 am
Contact:

Re: how to mange event MouseLeave

Post by jvierra » Thu May 02, 2019 2:54 pm

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.

jdm1977
Posts: 2
Joined: Thu May 02, 2019 8:22 pm

Re: how to mange event MouseLeave

Post by jdm1977 » Sun May 05, 2019 8:20 pm

"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 :)

jvierra
Posts: 13992
Joined: Tue May 22, 2007 9:57 am
Contact:

Re: how to mange event MouseLeave

Post by jvierra » Mon May 06, 2019 3:30 am

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.

Locked