Keypress error with user control
I am having a strange problem.
I am trying to pass a Keypress from a text box in a user control I developed to the form.
Evertime I add
Private Sub txtDate_KeyPress(KeyAscii As Integer) to the form code and run the program i get the following error:
"Interface not valid for Implements"
I have never seen this before. Any help appreciated
Some code:
In beginning of User Control
'Event Declarations:
Event KeyPress(KeyAscii As Integer) 'MappingInfo=TextBox,TextBox,-1,KeyPress
Event KeyDown(KeyCode As Integer, Shift As Integer) 'MappingInfo=TextBox,TextBox,-1,KeyDown
Event Validate(Cancel As Boolean) 'MappingInfo=TextBox,TextBox,-1,Validate
Further down in User Control
Private Sub TextBox_KeyPress(KeyAscii As Integer)
RaiseEvent KeyPress(KeyAscii)
End Sub
In Form Code
Private Sub txtDate_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then Call FilterSub
End Sub