Search code examples
c#winformscompact-frameworkwindows-ce

How can I scroll through a webpage in the WebBrowser control?


I'm developing an application for Windows CE with Compact Framework 2.5.

The application I'm developing is basically a WebControl. The customer wants the scrollbars hidden (which I have managed), but still wants to be able to scroll through the loaded webpage using the arrow keys on the PDA. However I cannot find a way to control were in the document the WebBrowser currently is?

Does anyone have any ideas? Or a possible alternative to the WebBrowser control, since I have come to the conclusion that the implementation in the Compact Framework is very poor considering the full framework.


Solution

  • Is this a Windows CE or Windows Mobile device?

    For windows mobile there are two rendering engines available since AKU 6.1.4: the 'old' PIE and the new IE6 'compatible' engine (http://www.hjgode.de/wp/2013/11/04/windows-mobile-6-internet-explorer-mobile-modes/). The reg key HKLM/security/internet explorer/mshtml value controls the rendering engine used by "Internet Explorer Mobile" (iexplore.exe). The PIE engine display scrollbars by default, the IE6 one not, it can be navigated by the navigation keys. There is a hotfix for compact framework correcting the navigation keys usage: http://support.microsoft.com/kb/975281

    If this is a real Windows CE device: if it is a Windows CE 5 based device then there are examples of using the webbrowser control in C/C++ called iesimple etc (AFAIR). Comapct Framework only implements part of the webbrowser API.

    It sounds like you are trying to write yet another kiosk mode browser although there are already many out there. Some are device manufacturer dependent, like Intermec Browser, some are usable on generic Windows Mobile devices, like Naurtech Browser (http://www.naurtech.com/products_em.php). These browsers support a bunch of options to control the kiosk mode and usage. I would only write my own kiosk mode browser for simple usage scenarios.

    AFAIK there is no way to know from program code, which part of a web page is shown to the user. And it makes no sense to me for a program to know what is currently rendered to the screen. The html and javascript code controls the workflow and data display and change.

    There maybe others but the only html engine supporting a SDK beside the MS webbrowser control is ZetaKey. There webkit engine is available for Windows CE/Mobile and they offer a SDK (I do not know there licensing and pricing model). Some open source initiatives have been discontinued, like MiniMo (Mozilla/Firefox).

    Please let us know more details about the device and your intention to write your own kiosk mode browser if you need further assistance.