Public Class Form1
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
' WebBrowser1.DocumentText =
' "<html><body>Please enter your name:<br/>" &
' "<input type='text' name='userName'/><br/>" &
' "<a href='http://www.microsoft.com'>continue</a>" &
' "</body></html>"
WebBrowser1.ScriptErrorsSuppressed = True
WebBrowser1.IsWebBrowserContextMenuEnabled = False
' Me.MinimumSize = New Size(1000, 650)
Me.StartPosition = FormStartPosition.CenterScreen
Me.Left = 40
Me.Top = 20
WebBrowser1.Navigate("https://www.kidzsearch.com/")
End Sub
Private Sub WebBrowser1_DocumentCompleted(sender As Object, e As WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted
AddHandler WebBrowser1.Document.MouseUp, AddressOf eventSub
TextBox1.Text = TextBox1.Text & ControlChars.NewLine & "Private Sub WebBrowser1_DocumentCompleted"
End Sub
Sub eventSub(ByVal sender As Object, ByVal e As System.Windows.Forms.HtmlElementEventArgs)
Dim event_html As New HtmlElementEventHandler(AddressOf webMouseUp)
event_html.Invoke(sender, e)
TextBox1.Text = TextBox1.Text & ControlChars.NewLine & "Sub eventSub"
End Sub
Sub webMouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.HtmlElementEventArgs)
If e.MouseButtonsPressed = Windows.Forms.MouseButtons.Left Then
' MsgBox("left clicked!")
End If
TextBox1.Text = TextBox1.Text & ControlChars.NewLine & "Sub webMouseUp"
CloseIExplore()
End Sub
Private Sub WebBrowser1_Navigating(sender As Object, e As WebBrowserNavigatingEventArgs) Handles WebBrowser1.Navigating
' If e.Url.ToString.Contains("about:blank") Or e.Url.ToString.Contains("xbox.com") Then
' e.Cancel = True
' End If
TextBox1.Text = TextBox1.Text & ControlChars.NewLine & e.Url.ToString
End Sub
Private Sub CloseIExplore()
Dim processArray As Process() = Process.GetProcessesByName("iexplore")
For Each p As Process In processArray
p.Close()
TextBox1.Text = TextBox1.Text & ControlChars.NewLine & "For Each p As Process"
Next
TextBox1.Text = TextBox1.Text & ControlChars.NewLine & "Private Sub CloseIExplore()"
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
WebBrowser1.GoBack()
End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
CloseIExplore()
End Sub
Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
TextBox1.Text = TextBox1.Text & ControlChars.NewLine & "----"
TextBox1.Text = TextBox1.Text & ControlChars.NewLine & "----"
End Sub
End Class