By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,335 Members | 1,310 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,335 IT Pros & Developers. It's quick & easy.

all key events not registering

P: n/a
Hi, I have a class that extends UserControl, and I'm attempting to capture
the keydown event, but it never fires when a key is pressed.

protected override void OnKeyDown(KeyEventArgs e) {
Console.WriteLine("keydown");
}

I've also tried overriding the OnKeyUp method, and using events to handle
this but still nothing is fired.
The control sits on a Form.

Anyone know what could be wrong?
Thanks
Nov 13 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Ah, nevermind...Had to call the Focus method on the control.

"Alien" <al***@sympatico.ca> wrote in message
news:EE******************@news02.bloor.is.net.cabl e.rogers.com...
Hi, I have a class that extends UserControl, and I'm attempting to capture
the keydown event, but it never fires when a key is pressed.

protected override void OnKeyDown(KeyEventArgs e) {
Console.WriteLine("keydown");
}

I've also tried overriding the OnKeyUp method, and using events to handle
this but still nothing is fired.
The control sits on a Form.

Anyone know what could be wrong?
Thanks

Nov 13 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.