vollmesg
asked on
Keypress for any control on form
I am using visual basic 2010 and I am trying to determine if there is any activity on a form (keypresses, mourseclicks, etc). Is there any way to do this besides adding a keypress and mouseclick event on every control?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
For the other events, you can do the following.
Create the event procedure for one of the controls.
Remove the Handles clause at the end of the method declaration.
Add something like the following code at the end of the Form_Load event:
Open in new window
Here is one for the MouseClick:Open in new window
Inside of the event, if you need to reference the control that triggerend the event, you can do the following with the sender parameter:Open in new window