all groups > dotnet compact framework > july 2005 >
You're in the

dotnet compact framework

group:

No KeyDown events after placing OpenNetCF webbrowser control?


No KeyDown events after placing OpenNetCF webbrowser control? Felix Joachim
7/31/2005 12:00:00 AM
dotnet compact framework: Hi,

I've had a problem with not getting any KeyDown events in my program for
some time. After some experimenting with empty forms I found out that
they stopped being raised after putting a webbrowser control on the form.

Re: No KeyDown events after placing OpenNetCF webbrowser control? Felix Joachim
7/31/2005 12:00:00 AM
So far I've only added some code to the KeyEventHandler of the form and
the webbrowser component.

The .Net 2.0 webbrowser control doesn't have any key events as it seems.


[quoted text, click to view]
Re: No KeyDown events after placing OpenNetCF webbrowser control? ctacke/
7/31/2005 7:02:36 AM
So the entire app quits getting key down events? How are you trying to trap
them?

-Chris


[quoted text, click to view]

Re: No KeyDown events after placing OpenNetCF webbrowser control? Paul G. Tobey [eMVP]
8/2/2005 10:55:22 AM
I'm not surprised about that. If the browser has the focus, and I'd be
surprised if it didn't, why would keys end up at your form? The browser is
using them.

For this kind of thing, RegisterHotKey() may be an appropriate solution,
although you may want to unregister your hotkeys for the cursor when your
application is deactivated, so that the user doesn't get action in your
application when using the keys in some other application.

Alternatively, use ApplicationEx from OpenNETCF and an IMessageFilter to
catch all keypresses and do whatever with the cursor keys as they arrive.

Paul T.

[quoted text, click to view]

Re: No KeyDown events after placing OpenNetCF webbrowser control? Paul G. Tobey [eMVP]
8/2/2005 11:24:54 AM
The browser is just wrapping the real native control, I'm sure. That's what
has focus and, if that's true, the keys don't pass through managed code
event handlers before going to the real control.

Paul T.

[quoted text, click to view]
Re: No KeyDown events after placing OpenNetCF webbrowser control? Felix Joachim
8/2/2005 7:46:32 PM
Hi,
can somebody confirm this problem, or is there some easy solution?

What I wanted to do is let the user use the hardware cursor keys to do
some stuff in the application while the webbrowser component is activated.
At the moment I don't get any key events when a browser is on the form
though.



[quoted text, click to view]
Re: No KeyDown events after placing OpenNetCF webbrowser control? Felix Joachim
8/2/2005 8:03:35 PM
Of course the form won't get events if the browser has focus.

Why doesn't the browser get any then though, if I put some code in it's
key-events?


[quoted text, click to view]
RE: No KeyDown events after placing OpenNetCF webbrowser control? sweepmaster
8/30/2006 7:34:28 AM
Are you shure its the webbrowser control? I have the same problem after adding the listView..

From http://www.developmentnow.com/g/18_2005_7_0_0_570756/No-KeyDown-events-after-placing-OpenNetCF-webbrowser-control.htm

Posted via DevelopmentNow.com Groups
AddThis Social Bookmark Button