PC Review Forums Newsgroups Microsoft DotNet Microsoft Dot NET Compact Framework No KeyDown events after placing OpenNetCF webbrowser control?

Reply

No KeyDown events after placing OpenNetCF webbrowser control?

 
Thread Tools Rate Thread
Old 31-07-2005, 11:44 AM   #1
Felix Joachim
Guest
 
Posts: n/a
Default No KeyDown events after placing OpenNetCF webbrowser control?


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.

Any ideas why this happens or what to do about it?
  Reply With Quote
Old 31-07-2005, 12:02 PM   #2
Guest
 
Posts: n/a
Default Re: No KeyDown events after placing OpenNetCF webbrowser control?

So the entire app quits getting key down events? How are you trying to trap
them?

-Chris


"Felix Joachim" <felix339@web.de> wrote in message
news:8f10d$42ecaba1$54b2cbe4$5046@nf1.news-service.com...
> 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.
>
> Any ideas why this happens or what to do about it?



  Reply With Quote
Old 31-07-2005, 04:18 PM   #3
Felix Joachim
Guest
 
Posts: n/a
Default Re: No KeyDown events after placing OpenNetCF webbrowser control?

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.


<ctacke/> wrote:
> So the entire app quits getting key down events? How are you trying to trap
> them?
>
> -Chris
>
>
> "Felix Joachim" <felix339@web.de> wrote in message
> news:8f10d$42ecaba1$54b2cbe4$5046@nf1.news-service.com...
>
>>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.
>>
>>Any ideas why this happens or what to do about it?

>
>
>

  Reply With Quote
Old 02-08-2005, 06:46 PM   #4
Felix Joachim
Guest
 
Posts: n/a
Default Re: No KeyDown events after placing OpenNetCF webbrowser control?

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.



Felix Joachim wrote:
> 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.
>
>
> <ctacke/> wrote:
>
>> So the entire app quits getting key down events? How are you trying
>> to trap them?
>>
>> -Chris
>>
>>
>> "Felix Joachim" <felix339@web.de> wrote in message
>> news:8f10d$42ecaba1$54b2cbe4$5046@nf1.news-service.com...
>>
>>> 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.
>>>
>>> Any ideas why this happens or what to do about it?

>>
>>
>>
>>

  Reply With Quote
Old 02-08-2005, 06:55 PM   #5
Paul G. Tobey [eMVP]
Guest
 
Posts: n/a
Default Re: No KeyDown events after placing OpenNetCF webbrowser control?

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.

"Felix Joachim" <felix339@web.de> wrote in message
news:274b7$42efb177$54b2cf33$4259@nf1.news-service.com...
> 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.
>
>
>
> Felix Joachim wrote:
>> 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.
>>
>>
>> <ctacke/> wrote:
>>
>>> So the entire app quits getting key down events? How are you trying to
>>> trap them?
>>>
>>> -Chris
>>>
>>>
>>> "Felix Joachim" <felix339@web.de> wrote in message
>>> news:8f10d$42ecaba1$54b2cbe4$5046@nf1.news-service.com...
>>>
>>>> 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.
>>>>
>>>> Any ideas why this happens or what to do about it?
>>>
>>>
>>>
>>>



  Reply With Quote
Old 02-08-2005, 07:03 PM   #6
Felix Joachim
Guest
 
Posts: n/a
Default Re: No KeyDown events after placing OpenNetCF webbrowser control?

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?


Paul G. Tobey [eMVP] wrote:
> 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.
>
> "Felix Joachim" <felix339@web.de> wrote in message
> news:274b7$42efb177$54b2cf33$4259@nf1.news-service.com...
>
>>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.
>>
>>
>>
>>Felix Joachim wrote:
>>
>>>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.
>>>
>>>
>>><ctacke/> wrote:
>>>
>>>
>>>>So the entire app quits getting key down events? How are you trying to
>>>>trap them?
>>>>
>>>>-Chris
>>>>
>>>>
>>>>"Felix Joachim" <felix339@web.de> wrote in message
>>>>news:8f10d$42ecaba1$54b2cbe4$5046@nf1.news-service.com...
>>>>
>>>>
>>>>>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.
>>>>>
>>>>>Any ideas why this happens or what to do about it?
>>>>
>>>>
>>>>
>>>>

>
>

  Reply With Quote
Old 02-08-2005, 07:24 PM   #7
Paul G. Tobey [eMVP]
Guest
 
Posts: n/a
Default Re: No KeyDown events after placing OpenNetCF webbrowser control?

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.

"Felix Joachim" <felix339@web.de> wrote in message
news:8be5$42efb577$54b2cf33$5123@nf1.news-service.com...
> 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?
>
>
> Paul G. Tobey [eMVP] wrote:
>> 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.
>>
>> "Felix Joachim" <felix339@web.de> wrote in message
>> news:274b7$42efb177$54b2cf33$4259@nf1.news-service.com...
>>
>>>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.
>>>
>>>
>>>
>>>Felix Joachim wrote:
>>>
>>>>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.
>>>>
>>>>
>>>><ctacke/> wrote:
>>>>
>>>>
>>>>>So the entire app quits getting key down events? How are you trying to
>>>>>trap them?
>>>>>
>>>>>-Chris
>>>>>
>>>>>
>>>>>"Felix Joachim" <felix339@web.de> wrote in message
>>>>>news:8f10d$42ecaba1$54b2cbe4$5046@nf1.news-service.com...
>>>>>
>>>>>
>>>>>>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.
>>>>>>
>>>>>>Any ideas why this happens or what to do about it?
>>>>>
>>>>>
>>>>>
>>>>>

>>


  Reply With Quote
Old 30-08-2006, 03:34 PM   #8
sweepmaster
Guest
 
Posts: n/a
Default RE: No KeyDown events after placing OpenNetCF webbrowser control?

Are you shure its the webbrowser control? I have the same problem after adding the listView.

From http://www.developmentnow.com/g/18_...wser-control.ht

Posted via DevelopmentNow.com Group
http://www.developmentnow.com
  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off