G
Guest
The .NET WebBrowser control in the Compact Framework 2.0 is a major
headache.
Once it takes the focus (e.g. by the user tapping on it) it keeps it
and keyboard events are not passed to the form anymore even though
KeyPreview is set to true.
If there are no other controls on the form we don't get them at all to
start with.
I added a tiny textbox with same colors as the form so we can at least
get the focus and be passed keyboard events. This works as long as it
has the focus and also when I give it focus again with SetFocus().
I tried adding a handler for the WebBrowser's KeyDown but that does not
help.
Next I put the browser control on a panel, setting the panel's Enabled
to false. This works, but the we cannot use the arrows in the browser,
scrollbars don't work, and so on.
Next I tried adding a timer which keeps setting the focus to the
textbox, this way the scrollbars still work but key events like the
arrows don't get to the browser (even when I enable the panel again).
What I did next is disable the panel again, and post a Windows message
to the browser control for interesting key events (if the panel is not
disabled, things start looping). But this does not help for the
scrollbars (and I don't know to intercept scrollbar events and pass
them on to the browser control).
Anybody any ideas?
I am using VS 2005.
Thanks,
Ruud
headache.
Once it takes the focus (e.g. by the user tapping on it) it keeps it
and keyboard events are not passed to the form anymore even though
KeyPreview is set to true.
If there are no other controls on the form we don't get them at all to
start with.
I added a tiny textbox with same colors as the form so we can at least
get the focus and be passed keyboard events. This works as long as it
has the focus and also when I give it focus again with SetFocus().
I tried adding a handler for the WebBrowser's KeyDown but that does not
help.
Next I put the browser control on a panel, setting the panel's Enabled
to false. This works, but the we cannot use the arrows in the browser,
scrollbars don't work, and so on.
Next I tried adding a timer which keeps setting the focus to the
textbox, this way the scrollbars still work but key events like the
arrows don't get to the browser (even when I enable the panel again).
What I did next is disable the panel again, and post a Windows message
to the browser control for interesting key events (if the panel is not
disabled, things start looping). But this does not help for the
scrollbars (and I don't know to intercept scrollbar events and pass
them on to the browser control).
Anybody any ideas?
I am using VS 2005.
Thanks,
Ruud