开发者

Catch keypresses in C#

开发者 https://www.devze.com 2022-12-19 13:21 出处:网络
I need to catch keypresses in my C# program that has a WebBrowser control in it. I know how to do it if there isn\'t any controls on the form or if I use a textbox or sim开发者_Go百科ilar but the We

I need to catch keypresses in my C# program that has a WebBrowser control in it.

I know how to do it if there isn't any controls on the form or if I use a textbox or sim开发者_Go百科ilar but the WebBrowser control seems to handle all keypresses itself.

Is there any way to override the WebBrowser_KeyDown function?


Set the KeyPreview property on the Form to True:

http://msdn.microsoft.com/en-us/library/system.windows.forms.form.keypreview.aspx

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号