Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MouseHover event not available #2193

Closed
StormStark opened this issue Nov 15, 2019 · 3 comments
Closed

MouseHover event not available #2193

StormStark opened this issue Nov 15, 2019 · 3 comments

Comments

@StormStark
Copy link

I wanted change the default border color of the button and textbox when the mouse is hovering over the element.
Many websites show there is a MouseHover event present. I noticed there is a lot of mouse events (moseOver, mouseEnter, mouseLeave ,etc. ) presrnt but MouseHover.

Is there any other event that will do the trick?

@weltkante
Copy link

weltkante commented Nov 15, 2019

TooltipService/PopupControlService implement the hover pattern, I don't think there's anything besides tooltips requiring the hover pattern in the average Desktop application which is probably the reason its not exposed as event (usually you react on MouseOver without delay or have the delay built into whatever you do, e.g. an animation is started immediately on mouseover but has delay until it becomes apparent).

If you want to show a popup you can just use the tooltip functionality, otherwise you'll probably have to use 3rd party code or build the functionality you need by yourself, reacting on mouse events and starting a timer.

@miloush
Copy link
Contributor

miloush commented Nov 15, 2019

The MouseHover event is a Windows Forms event: https://docs.microsoft.com/en-us/dotnet/api/system.windows.forms.control.mousehover. It is not available on WPF.

If you want to change a style for an element when mouse is over, use Style with IsMouseOver Trigger. See e.g. https://stackoverflow.com/questions/17259280/how-do-you-change-background-for-a-button-mouseover-in-wpf

If you really want to wait for a bit, another option to what @weltkante mentioned is to start an animation on the trigger.

@arpitmathur
Copy link
Contributor

@StormStark: WPF doesn't have this event by design and there are no current plans to add it.

@dotnet dotnet locked as resolved and limited conversation to collaborators Apr 14, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants