Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Compact Framework / April 2006

Tip: Looking for answers? Try searching our database.

WebBrowser in .NET Compact Framework eats my events

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
spamlaanbroek@hetnet.nl - 30 Mar 2006 19:23 GMT
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
Brian Nantz - 31 Mar 2006 15:33 GMT
I have heard that the one in the OpenNetCF is easier to use.

> The .NET WebBrowser control in the Compact Framework 2.0 is a major
> headache.
[quoted text clipped - 33 lines]
>
> Ruud
Ruud Laanbroek - 04 Apr 2006 09:58 GMT
Thanks. I did not use the OpenNETCF WebBrowser after all, but you
pointed me in the right direction.

I used the OpenNETCF ApplicationEx class and IMessageFilter interface:
- used the ApplicationEx.Run instead of Application.Run
- added a PreFilterMessage() method to my form (now also inheriting the
IMessageFilter interface)
- added ApplicationEx.AddMessageFilter(this) to the constructor of the
form

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.