Search - Articles
DevASP.NET for ASP.NET, VB.NET, XML and C# (C-Sharp) Developers Tuesday, March 03, 2009
Dev Articles
Search Directory
ASP.NET
VB.Net
C-Sharp
SQL Server
 

How to access a web page in Windows Form using Visual Basic.Net.

Author: Shahzad

Some desktop applications may require accessing a web page or a website. It could be done very easily in VB.Net. This article will help you complete this task.

First of all right click on the Windows Form tab in the tool box of Visual Studio.Net, and from the context menu select “Add/Remove Item” option.  Now, choose COM Components tab and find a component named as “Microsoft Web Browser”. In order to add this control in the tool box  click on the check box at the left. Make sure it is checked. This way you’ll be able to see Microsoft Web Browser control in the tool box.

 

Drag and drop this control on the Windows Form and adjust width and height and other properties as you like.  Now, add a text box names txtURL and a command button names cmdGo.

 

In the click event of cmdGo add the following line of code.

 

Me.wb1.Navigate(Me.txtURL.Text)

 

The name of our web browser control is wb1. Enter the URL of your favorite website in the text box and click go. You’ll see that the web page will be displayed on the form inside the web browser control

 

   
Add Article Comment:
Name :
Email Address :
   
Comments :
 
   
<< How exception handling is done in VB.Net and how to create custom exception.

Disclaimer - Privacy
© 2002-2017 DevASP.net