Why did not the KeyPress event occur? 
Author Message
 Why did not the KeyPress event occur?

Hi,

I placed a textbox on my form and wrote code in KeyPress and KeyDown event
respectively. Then I placed breakpoints both at these events(subs). Whenever
I typed in the textbox, only KeyDown event raised (breakpoint highlighted)
and never the KeyPress event. Can someone tell me why? How does VB manager
events queue?

Thanks

Bill



Sat, 02 Jul 2005 11:58:24 GMT  
 Why did not the KeyPress event occur?

They will both fire for normal keys, although only keydown/up work for
function, editing and navigation keys.
However if you place a breakpoint or a msgbox in keydown, then keypress will
not fire, which is probably what you are experiencing. Try using debug.print
statements to see event execution order rather than breakpoints and
messageboxes which tend to interfere with events.


Quote:
> Hi,

> I placed a textbox on my form and wrote code in KeyPress and KeyDown event
> respectively. Then I placed breakpoints both at these events(subs).
Whenever
> I typed in the textbox, only KeyDown event raised (breakpoint highlighted)
> and never the KeyPress event. Can someone tell me why? How does VB manager
> events queue?

> Thanks

> Bill



Sat, 02 Jul 2005 23:50:53 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Form's KeyPress event not firing - WHY???

2. Why won't form activate event occur?

3. Why is TAB key trapped in Keypress event?

4. NewMail event does not occur during startup

5. NewMail event does not occur during startup

6. Label change event not occurring when Message Box displayed

7. DataCombo _Change event not occurring

8. GotFocus event not occurring after MsgBox

9. Text box not getting KeyPress event.

10. ListBox does not receive the KeyPress Event??

11. Keypress Event does not work always

12. Form close event occurs before lost focus event

 

 
Powered by phpBB® Forum Software