Hey. I'm having a problem. In a form's constructor, I have:

this.KeyDown+=new KeyEventHandler(frmGScreen_KeyDown)

but the event handler does not invoke at all when I press a key on the keyboard. I know this because i have the code "txtOutput.Text="Event handler entered" as the first line of the handler, and nothing happens, and besides, the actions coded for specific keys do not execute.

I do have the form's KeyPreview property set to true. So this one truly stumps me. I just don't get it...

Recommended Answers

All 3 Replies

try:

this.KeyPress+=new KeyEventHandler(frmGScreen_KeyDown)

If it doesnt work, show me the rest of the program; as the error is not in that line.

I guess I should have marked this as solved because i did fix it quit a while ago....cant remember how though..

Wow, i didnt realise this thread was so old. Sorry to bring it up again, but i found this thread as i was searching for tutorials on google.
Do you have an IM adress?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.