|
-
Mar 30th, 2005, 04:18 PM
#1
Thread Starter
Lively Member
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???
-
Apr 21st, 2005, 04:25 PM
#2
Frenzied Member
Re: How to add a Key_Press event to an user control
 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??? 
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|