1 Replies - 289 Views - Last Post: 11 July 2014 - 02:06 AM Rate Topic: -----

#1 kuzto1  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 09-July 14

WP8 VB NET SDK Website snapping to webbrowser

Posted 09 July 2014 - 11:53 PM

so im making an app that shows a website in a webbrowser. Pretty basic, but ive rann into a problem.

I need the entire website to be snapped into the webbrowser so i dont scroll around the website, but have everything on 1 screen. Any ideas?
Is This A Good Question/Topic? 0
  • +

Replies To: WP8 VB NET SDK Website snapping to webbrowser

#2 Kizzle  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 10
  • Joined: 07-July 14

Re: WP8 VB NET SDK Website snapping to webbrowser

Posted 11 July 2014 - 02:06 AM

This code will work fine if added to the web browser document complete event, however as soon as the form is resized it will no longer work, so you will need to look into that


        Dim webDocument As Size = WebBrowser1.document.Body.ScrollRectangle.Size
        webDocument = Size.Add(webDocument, New Size(50, 50))

        Dim webBrowser As Size = WebBrowser1.Size
        Dim newSize As String = (Math.Round(Math.Min(webBrowser.Width / webdocument.Width, webBrowser.Height / _
webdocument.Width), 2) * 100).ToString & "%"

        WebBrowser1.document.Body.Style = "zoom:" & newSize


Was This Post Helpful? 0
  • +
  • -

Page 1 of 1