|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Announcements
Chapters
Services
Feature Zones
|
IntroductionI have seen several messages on various VB.NET boards regarding problems with the Using the codeFirstly, add a Private WithEvents doc As SHDocVw.DWebBrowserEvents_Event
'/// doc will handle all the events for brweb now...
Private Sub Form1_Load(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles MyBase.Load
Dim b As Object = brWeb.Application
doc = DirectCast(b, SHDocVw.WebBrowser_V1)
'///set doc as the active handler for brweb's events.
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Button1.Click
brWeb.Navigate("http://google.com") '///lets navigate to a website.
End Sub
Private Sub doc_BeforeNavigate(ByVal URL As String, _
ByVal Flags As Integer, ByVal TargetFrameName As String, _
ByRef PostData As Object, ByVal Headers As String, _
ByRef Cancel As Boolean) Handles doc.BeforeNavigate
MessageBox.Show(URL) '/// check that before navigate now works.
End Sub
Private Sub doc_StatusTextChange(ByVal _
[Text] As String) Handles doc.StatusTextChange
Label1.Text = Text '///show the status text in a label.
End Sub
Private Sub doc_TitleChange(ByVal [Text] As String) _
Handles doc.TitleChange
MyBase.Text = Text '/// set the form's caption to the current url
End Sub
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||