SpeakComputers.com online store
Electronics Software Computers Handhelds Laptops and Tablets Mobile Phones Digital Cameras Camcorders Games Music Books Sport Mens and Womens Watches Power Tools Household appliances

PRODUCTS

Adobe Flash Dream Weaver Visual Studio Adobe Fireworks Web Design Books Adobe Web Design Books HTML Books Microsoft Web Development

VB.NET WebBrowser Control.

The VB.NET Windows.Forms.WebBrowser control can be used within applications to allow the user to surf the internet and open web enabled documents like html help files, word documents etc.

The control is a basic webbrowser control and is by no means perfect. When using the control for surfing the internet, you will notice that it does not respond to Flash objects correctly. With the Flash objects, the control will only rspond once (click) on the Flash object.

The control includes several navigation methods or functions as: Url ,Navigate ,GoBack ,GoForward ,GoHome, GoSearch.

Namespace: System::Windows::Forms
System.Windows.Forms (in system.windows.forms.dll)

Creating an new VB.NET Windows forms WebBrowser.
Dim webbrowser As New WebBrowser

Setting the DockStyle for the WebBrowser.
webbrowser.Dock = DockStyle.Fill

Navigating Home with the WebBrowser Control.
webbrowser.GoHome()

Navigating to a specific web site.
webbrowser.Navigate("http://www.speakcomputers.com")

Adding a VB.NET WebBrowser control to the form.
Me.Controls.Add(webbrowser)

Creating a DocumentCompleted Event for the VB.NET WebBrowser control.
AddHandler webbrowser.DocumentCompleted, AddressOf webbrowser_documentcompleted

Responding to the VB.NET DocumentCompleted event.
Private Sub webbrowser_documentcompleted(ByVal sender As Object, ByVal e As WebBrowserDocumentCompletedEventArgs)
Me.BackButton.Enabled = webbrowser.CanGoBack
Me.Forwardbutton.Enabled = webbrowser.CanGoForward
Me.TextBox1.Text = webbrowser.Url.ToString()
End Sub

VB.NET WebBrowser control Tutorial.

To display the Print Dialog Box.
webbrowser.ShowPrintDialog()

To display the Print Preview Dialog Box.
webbrowser.ShowPrintPreviewDialog()

To display the Properties Dialog Box.
webbrowser.ShowPropertiesDialog()

Home About Privacy Policy Resouces Search

Copy Right 2006 SpeakComputers.com - All Rights Reserved.