filmov
tv
Beginner Web Browser Tutorial - Visual Basic 2010
Показать описание
Hi,
This is a simple web browser tutorial for beginner. in this tutorial you will learn how to navigate the web browser to a website, while being able to go back and forward to sites already navigated too & how to show the website title.
-------------------------------------------------------------------------
Here is the code:
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
WebBrowser1.GoBack()
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
WebBrowser1.GoForward()
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
WebBrowser1.Navigate("http://" + TextBox1.Text)
End Sub
Private Sub WebBrowser1_DocumentCompleted(ByVal sender As System.Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted
Label1.Text = WebBrowser1.DocumentTitle
WebBrowser1.ScriptErrorsSuppressed = True
End Sub
Private Sub WebBrowser1_Navigating(ByVal sender As Object, ByVal e As System.Windows.Forms.WebBrowserNavigatingEventArgs) Handles WebBrowser1.Navigating
Label1.Text = WebBrowser1.DocumentTitle
End Sub
End Class
--------------------------------------------------------------------------------------------
This is a simple web browser tutorial for beginner. in this tutorial you will learn how to navigate the web browser to a website, while being able to go back and forward to sites already navigated too & how to show the website title.
-------------------------------------------------------------------------
Here is the code:
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
WebBrowser1.GoBack()
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
WebBrowser1.GoForward()
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
WebBrowser1.Navigate("http://" + TextBox1.Text)
End Sub
Private Sub WebBrowser1_DocumentCompleted(ByVal sender As System.Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted
Label1.Text = WebBrowser1.DocumentTitle
WebBrowser1.ScriptErrorsSuppressed = True
End Sub
Private Sub WebBrowser1_Navigating(ByVal sender As Object, ByVal e As System.Windows.Forms.WebBrowserNavigatingEventArgs) Handles WebBrowser1.Navigating
Label1.Text = WebBrowser1.DocumentTitle
End Sub
End Class
--------------------------------------------------------------------------------------------
Комментарии