Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27384

VS 2010 WebBrowser Zoom

$
0
0
Hi Guys,

Need a little help. I have a project in VS 2010 where I have created a 4 quadrant web browser, so each browser looks at something different (for monitoring purposes). With having the 4 quadrants, it means some things are a little out of view on the webpages, so I had to add some sort of functionailty to zoom in/out to a desired level. To do this I used the following code:

Code:

 
    Private Sub Button1_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        WebBrowser1.Document.Body.Style = "zoom: " & TextBox1.Text & "%"
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        WebBrowser2.Document.Body.Style = "zoom: " & TextBox1.Text & "%"
    End Sub

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        WebBrowser3.Document.Body.Style = "zoom: " & TextBox1.Text & "%"
    End Sub

    Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
        WebBrowser4.Document.Body.Style = "zoom: " & TextBox1.Text & "%"
    End Sub

So what the above is doing is looking in a text box and using that number to change the zoom level on a certain WebBrowser depending on which of the 4 buttons are pressed.

My problem is the monitoring software used auto refreshes the page at set intervals (with no way of preventing this) and everytime it refreshes it loses its zoom setting and goes back to the original size.

How can I make the zoom persistant even after refresh?

Thanks.

Viewing all articles
Browse latest Browse all 27384

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>