Make Your First ActiveX Control
Implementing The KeyPress Event
We don't want to
change the KeyPress Event.
We want that the code the user will insert to the
Event (Image 11) will be
launched as usual,
So we will
enter the following lines to our form:
Command1_KeyPress(KeyAscii As Integer)
Code Explanation: when the user press on the Command1
simply launch the Control (MyControl) KeyPress event.
The 'RaiseEvent' function launch an
It launch the
event with the KeyAscii parameter that has been
received from the Command1 KeyPress