Jump to content
  • Advertisement
Sign in to follow this  
ArchG

[.net] Catching Mouse Events over Controls (C#, WinForms)

This topic is 4288 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello, I am kinda trying to make a web browser application, that fades out (changes opacity) when you're not using it, and fades in when the mouse comes back over it. The problem is...I can't find an event that will fire when I bring the mouse over the application. I'm using the Web Browser control, which has no event for MouseOver, MouseEnter or anything like that. And, since I have the WebBrowser, set to Fill (for the Dock Property) it fills up the whole form, and the form will not fire mouse move, or mouse enter events. What do I do? Thanks, ArchG

Share this post


Link to post
Share on other sites
Advertisement
maybe you could create a user control that contains the webbrowser control. This user control could catch mouse events, even let you control the opacity. Since the browser control would be a child control of your user control, it would fade right along with it :-)

Share this post


Link to post
Share on other sites
Thanks for your response.

The problem with that though is first...User controls don't have a property for Opacity..(that doesn't really matter though as I could change the parent controls opacity from there...

the big problem is still with the browser control...the MouseEnter, MouseLeave, and MouseMove events won't fire when the mouse is overtop of the Browser control, even when it is 'embedded'? in the user control...

Any other solutions?

Share this post


Link to post
Share on other sites
As it's the mouse over event for your whole application, you could try using a message filter, so that once your application receives a message you know it's got focus and change the opacity - search for IMessageFilter or PreFilterMessage for examples.

Hope this helps!
Cheers,
Gary

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!