Problem - KeyDown even does not occur for UserControl in C#
-
2012년 1월 12일 목요일 오전 1:22
Hello.
I am working on KeyDown event control in C#.
Of course, it works in main.form, but not in Form.SplitterPanel.Panel1.UserControl.
I think "focus" and "keyPreview setting" is not a problem since KeyUp event method occurs with no problem.
I tried to solve this problem with many solutions through the Internet, but nothing could help.
I do not know key event occur for "KeyUp", but not for "KeyDown" and "KeyPress".
What is the big difference between them.
Please help me.
모든 응답
-
2012년 1월 13일 금요일 오전 7:16중재자
Hi SigmaElTec,
Thanks for posting here.You can find sample code for these events in MSDN.
and I could find similar issue.
http://social.msdn.microsoft.com/Forums/en-AU/winforms/thread/C8E3565D-05AE-4087-B934-F0A69CB3B61D
Hope this helps.
Reference
Control.KeyDown Event
http://msdn.microsoft.com/en-us/library/system.windows.forms.control.keydown.aspx
Control.KeyPress Event
http://msdn.microsoft.com/en-us/library/system.windows.forms.control.keypress.aspx
Control.KeyUp Event
http://msdn.microsoft.com/en-us/library/system.windows.forms.control.keyup.aspx
Control.OnKeyUp Method
http://msdn.microsoft.com/en-us/library/system.windows.forms.control.onkeyup.aspx
Control.OnKeyPress Method
http://msdn.microsoft.com/en-us/library/system.windows.forms.control.onkeypress.aspx
Control.OnKeyDown Method
http://msdn.microsoft.com/en-us/library/system.windows.forms.control.keyup.aspx
Regards,
Forum Support
Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
-
2012년 1월 18일 수요일 오전 6:32중재자
Hi,
Did any of the posts in this thread solve your problem or answer your question? We would like to close this post if possible, but want to make sure you received an accurate answer. Please mark the appropriate post as the answer by clicking the “Mark As Answer” button or respond to let us know that none of the posts address your issue. Thank you.
Regards,
Forum Support

