You posted code for a Form KeyPress but your question is about a textbox keypress.

Which one is giving you the problem?

If it is in a frame, I suspect it is the textbox, correct?

What is in your textboxs keypress event?