articles

Home / DeveloperSection / Articles / WebBrowser Control in VB.Net

WebBrowser Control in VB.Net

WebBrowser Control in VB.Net

Pushpendra Singh 21803 12-Dec-2010

The web browser Control in VB.Net

The WebBrowser Control Enables to navigate Web pages inside your form. Navigate method of WebBrowser Control - Loads the document into the WebBrowser control.

How to use WebBrowser control

Drag and drop WebBrowser Control from toolbox on window Form.

WebBrowser Control in VB.Net

Designing GUI

Now I add a label, TextBox, and a button.

WebBrowser Control in VB.Net

Code:

Write the below code in a button click.

Private Sub Button1_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
WebBrowser1.Navigate(TextBox1.Text) 'The Navigate method of browser control views a page in the viewer.
End Sub

 Run the project

WebBrowser Control in VB.Net

When you enter URL address in textbox and click the Go button then click event will fire and navigate method will open a website which URL address is given in TextBox.

WebBrowser Control in VB.Net

WebBrowser Properties

URL property:  Gets or sets the URL of the current Web page. Setting this property navigates the control to the new URL.

AllowNavigation:  Gets or sets a value indicating whether the control can navigate to another page after its initial page has been loaded. 

TabStop: Gets or sets a value indicating whether the user can give the focus to this control using the TAB key.

 


Updated 04-Mar-2020

Leave Comment

Comments

Liked By