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.
This topic is 4 years and 10 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
jdm1977
Posts: 2
Last visit: Wed May 15, 2019 1:41 am

how to mange event MouseLeave

Post 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...
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: how to mange event MouseLeave

Post 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.
jdm1977
Posts: 2
Last visit: Wed May 15, 2019 1:41 am

Re: how to mange event MouseLeave

Post 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 :)
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: how to mange event MouseLeave

Post 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.
This topic is 4 years and 10 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked