Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to fit page to Silverlight WebBrowser control?

I use WebBrowser Silverlight 4 control to load some page:

<WebBrowser Height="350" Name="webBrowser" Width="400" />
...
webBrowser.Navigate(new Uri("http://mail.live.com")); 

But page loads with horizontal and vertical scroll bars. So I'm trying to find some ways to get actual size of loaded page (then I can change Height/Width of control) OR change scale of loaded page (to fit it to the actual WebControl control). Is it possible to do with standard WebControl methods?

like image 801
Igor V Savchenko Avatar asked Jul 24 '10 10:07

Igor V Savchenko


1 Answers

The web browser component in Silverlight is a COM component that is wrapped by a Silverlight control.

You have two options. 1) Make the web site fluid inside the browser so that it will shrink with the browser.

Or

2) The only way that you could "shrink" the web site would be to set the Zoom. There is a link to do this here by tricking the mouse scroll wheel into zooming it for you.

http://forums.silverlight.net/forums/p/200177/466986.aspx

like image 51
Matt Hudson Avatar answered Sep 22 '22 18:09

Matt Hudson