J
Joe
Hi All,
I was trying to incorporate the keydown event to my userform. I
wanted to initiate the Closing when ESC button is pressed. The code
is given below.
'***********************************************************
Private Sub UserForm_KeyDown(ByVal KeyCode As MSForms.ReturnInteger,
ByVal Shift As Integer)
If KeyCode = vbKeyEscape Then
Msgbox "Reached "
call C_Close_Click()
End If
End Sub
'***********************************************************
This works fine for a blank userform.
But when I have some other controls like Button or listbox, this is
not working. Can anyone help ?
Why it happens like that and How can avoid this problem
Mine is Excel 2003 SP2 / VB 6.3
Thanks
Joe
I was trying to incorporate the keydown event to my userform. I
wanted to initiate the Closing when ESC button is pressed. The code
is given below.
'***********************************************************
Private Sub UserForm_KeyDown(ByVal KeyCode As MSForms.ReturnInteger,
ByVal Shift As Integer)
If KeyCode = vbKeyEscape Then
Msgbox "Reached "
call C_Close_Click()
End If
End Sub
'***********************************************************
This works fine for a blank userform.
But when I have some other controls like Button or listbox, this is
not working. Can anyone help ?
Why it happens like that and How can avoid this problem
Mine is Excel 2003 SP2 / VB 6.3
Thanks
Joe