I want to play a sound when the left mouse button is clicked anywhere in my form without having to place Mouse click events on every single control in the form. Is there a way to accomplish this?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can detect the Windows notification before it is dispatched to the control with the focus with the IMessageFilter interface. Make it look similar to this:
This works for any form in your project, not just the main one.