Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable scrolling in browser control for WP7?

Is it possible to disable the scrolling in a web browser control in Windows Phone 7.1? I have seen quite a few questions ask around it (Windows Phone 7.0, Silverlight) but an answer has yet to come up. Any ideas?

like image 993
Edward Avatar asked Nov 21 '11 20:11

Edward


2 Answers

There is a blog post here explaining how to suppress the zoom and scroll functionality of the WebBrowser control. Quote from that post:

The visual tree is quite simple, composed of a few grids and borders. The significant parts are the TileHost, which is the native IE9 component, and the PanZoomContainer. The TileHost does not handle the mouse manipulation events, these are instead handled by the PanZoomContainer, where they are then translated into gestures (i.e. pinch-zoom) with the result fed back to the TileHost.

What this means is that we can intercept the manipulation events as they bubble up to the PanZoomContainer, cancelling them before they are turned into gestures.

like image 179
keyboardP Avatar answered Oct 08 '22 22:10

keyboardP


Given the webbrowser:

To disable interaction set IsHitTextVisible= false

<phone:WebBrowser Height="600" IsHitTestVisible="False" />

To disable scrolling only, set ScrollViewer.VerticalScrollBarVisibility= disabled

<phone:WebBrowser Height="600" ScrollViewer.VerticalScrollBarVisibility="Disabled" />
like image 36
William Melani Avatar answered Oct 08 '22 20:10

William Melani