tags:

views:

111

answers:

1

Hi all, i really need to catch "ESC" key press while focus is on WebBrowser control. I tried something like this:

(webControl as Control).KeyPress += new KeyPressEventHandler(MyKeyPressEventHandler); 

But it doesnt work. The method is not called. I tried some methods, described here, but dont get any result ( Help, please.

+3  A: 

I believe you need to use javascript to do this, take a look at this link and see if it helps you out.

Get Key Press Event Using JavaScript from GeekPedia.com

GrowlingDog
Oh... I'd like to, but this is desctop aplication, and I dont know how to inject script into each page, that have been opened in WebBrowser control (standart control).
Pritorian
I'm assuming that you tried the PreviewKeyDown event that the WebBrowser control already has and that it isn't doing what you need, but I just wanted to confirm that before I look into this more
GrowlingDog