Disable scrolling in browser control for WP7?

痞子三分冷 提交于 2020-01-01 05:42:06

问题


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?


回答1:


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.




回答2:


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" />


来源:https://stackoverflow.com/questions/8218107/disable-scrolling-in-browser-control-for-wp7

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!