Mobile Zone is brought to you in partnership with:

Mitch Pronschinske is the Lead Research Analyst at DZone. Researching and compiling content for DZone's research guides is his primary job. He likes to make his own ringtones, watches cartoons/anime, enjoys card and board games, and plays the accordion. Mitch is a DZone Zone Leader and has posted 2577 posts at DZone. You can read more from them at their website. View Full User Profile

Windows Phone WebBrowser Control: Suppress Zoom and Scroll

  • submit to reddit

Why would you ever want to suppress zoom and scroll?  Well, the WebBrowser control lets you view websites within the context of a non-browser application so that you don't end up opening the browser when you just want to peek at something.  In these cases, you may want to stop the user from zooming or scrolling if the whole page is displayed.

Colin Eberhardt shows in his blog post that there is a way to suppress zoom and scroll with HTML5, but he doesn't like that it lets you do both of these things and only snaps back.  He instead finds a solution through the .NET Wrapper - the PanZoomController:

If you inspect the visual tree of the WebBrowser control you will find that it is assembled as follows:

          \-Border (*)

(visual tree dump generated via the oh-so-useful Linq to VisualTree utility!)

You can check out Colin's blog to see the utility class he made with the help of PanZoomController to fully supress zoom and scroll.



Schlacter Adam replied on Sat, 2012/04/14 - 2:39am

That is an amazing perception. I have a webBrowser which has to scroll vertically and not horizontally so I can use your solution with a little modification.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.