Question : Webbrowser Control in VB.NET Windows Application

I have a windows application where a webbrowser is embedded in a tabbed control...when the application starts the webbrowser shows a default graph from the web which is sized perfectly within the frame.  But if I update the webbrowser with a new graph, the size of the webpage is larger than the frame...presenting the user with scroll bars.  

How do I get the web page to fit in the window, as it was when the application started?

Below are some of the options that I've tried.

Any help would be much appreciated.

Public Sub graphUpdate()
        Dim myTicker = txtTicker.Text
        Dim myAddressDaily = ConfigurationManager.AppSettings("graph1Day") & myTicker
        Dim myAddressWeekly = ConfigurationManager.AppSettings("graph1Week") & myTicker
        Dim myAddressYearly = ConfigurationManager.AppSettings("graph1Year") & myTicker

        txtTicker.Text = UCase(txtTicker.Text)
        browserDaily.Navigate(myAddressDaily)
        browserWeekly.Navigate(myAddressWeekly)
        browserYearly.Navigate(myAddressYearly)

        txtHistory.Text = myTicker
       
        'Me.browserDaily.Dock = DockStyle.None
        'Me.browserDaily.Dock = DockStyle.Fill
        'Me.browserDaily.SetBounds(0, 0, 417, 220)
        'Me.browserDaily.MaximumSize() = "417"
        'Me.browserDaily.Top = 0
        'Me.browserDaily.Height = 200
        'Me.browserDaily.Width = 417
        'Me.browserDaily.Document.Body.ScrollLeft = 0

        formParent.ToolStripStatusLabel.Text = "Graphs refreshed...Ready"
    End Sub

Answer : Webbrowser Control in VB.NET Windows Application

You can even use it as the src of an image:

<img src="http://<ip>/web1?ANI=1120&NAME=Joe%20Smith&TOPIC=sales&WEBSITE=bweb.com" width="1" height="1" />

And it is not so hard to make that url return a transparent 1x1 pixel GIF image. For example using "Server.Transfer"
Random Solutions  
 
programming4us programming4us