WebBrowser won't fire DocumentCompleted event when in a TabPage

A

Andy B.

I have the code below in the MainForm of the program. The browser control is
in a tabPage that doesn't receive focus when the program starts. I will have
3 or so tabs on this form with web browser controls on each tab. How would I
make the DocumentComplete event fire even when the browsers don't have
focus?

[code:18 lines]

Imports WeatherBuilder

Public Class MainForm

Private Sub WeatherBug_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Load

WebBrowser1.Navigate("about: blank")

End Sub

Private Sub WebBrowser1_DocumentCompleted(ByVal sender As System.Object,
ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs)

If e.Url.OriginalString = "about: blank" Then

Dim LiveConditions As New Weather.LiveWeatherData()

LiveConditions = WeatherGenerator.GetLiveConditionsByZipCode("49001",
Weather.UnitType.English)

LiveConditionsToHtml(LiveConditions, WebBrowser1)

End If

End Sub

End Class
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top