J
Jess
How can I get a given control event -let say the textbox keypress event- to
be fired in a class module? I believe this is called multicasting in VB6.
The below code is the one I am unsuccessfully using: the TextBox_KeyPress is
not fired in the class module.
Form:
Dim amount As CTextBxN
Private Sub Form_Load()
Set amount = New CTextBxN
‘text1 is a textbox control on this form
Set amount.TextBox = Text1
End Sub
CTextBxN Class:
Public WithEvents TextBox as TextBox
public Sub TextBox_KeyPress(KeyAscii As Integer)
….event code…
End Sub
I have noticed that if the form has a declaration for the keypress event,
the latter is fired first in the form, and then in the class module.
In other words. I the below snippet of code is added to the form, the
keypress event is fired first in the form, and second in the class module.
public Sub TextBox_KeyPress(KeyAscii As Integer)
End Sub
Can anybody help me with this?
Thanks in advance
be fired in a class module? I believe this is called multicasting in VB6.
The below code is the one I am unsuccessfully using: the TextBox_KeyPress is
not fired in the class module.
Form:
Dim amount As CTextBxN
Private Sub Form_Load()
Set amount = New CTextBxN
‘text1 is a textbox control on this form
Set amount.TextBox = Text1
End Sub
CTextBxN Class:
Public WithEvents TextBox as TextBox
public Sub TextBox_KeyPress(KeyAscii As Integer)
….event code…
End Sub
I have noticed that if the form has a declaration for the keypress event,
the latter is fired first in the form, and then in the class module.
In other words. I the below snippet of code is added to the form, the
keypress event is fired first in the form, and second in the class module.
public Sub TextBox_KeyPress(KeyAscii As Integer)
End Sub
Can anybody help me with this?
Thanks in advance