How to add a Key_Press event to an user control
I created a user control that consists of a txt box and a drop down
to use it as my warehouse list, the user can either enter a code in the txtbox
(example: "04") and the drop down will display the desc of the warehouse for that code, and viceversa, now I want to add a Key_Press event..how do I do
that??? :confused:
Re: How to add a Key_Press event to an user control
Quote:
Originally Posted by npolo
I created a user control that consists of a txt box and a drop down
to use it as my warehouse list, the user can either enter a code in the txtbox
(example: "04") and the drop down will display the desc of the warehouse for that code, and viceversa, now I want to add a Key_Press event..how do I do
that??? :confused:
y don't u use ActiveX Control Interface Wizard? that makes it a lot easier..
in case you dont want to.. then you have to follow the following steps
1. Create a Public Event with same signature as that of Text box KeyPress
VB Code:
Public Event KeyPress (ByRef KeyAscii As Integer)
2.
then code in Text1_KeyPress as follows
VB Code:
Private Sub Text1_KeyPress(ByRef KeyAscii As Integer)
RaiseEvent KeyPress (KeyAscii)
End Sub