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

How to use web browser control in .net 2.0. (Part1)

Author: Zunnair
Download Source Code : 814_web

In this simple article you will learn that how to use Web Browser control in C# .net 2.0.

 Create new c# project. Drag one Textbox control, Label, Web Browser control, and one button on the windows form.

Now write code on form load event:


private void FrmWebBrowser_Load(object sender, EventArgs e)


            this.Text = "DevAsp Web Browser";

            txt_Url.Text = "";


            this.WindowState = FormWindowState.Maximized;



Private Sub FrmWebBrowser_Load(ByVal sender As Object, ByVal e As EventArgs)

        Me.Text = "DevAsp Web Browser"

        txt_Url.Text = ""


        Me.WindowState = FormWindowState.Maximized

    End Sub

Now write the following code on button click event:


private void btn_Go_Click(object sender, EventArgs e)







Private Sub btn_Go_Click(ByVal sender As Object, ByVal e As EventArgs)


    End Sub


It will get url address or string from the text box named “txt_Url” and load the site on the WebBrowser Control page.


Use Anchor property of WebBrowser control to maximize the WebBrowser page when the form get maximized.


Use  Url  property  to  set  the default page which will load first time automatically when the program will execute.


Add Article Comment:
Name :
Email Address :
Comments :
<< Sort all Strings in DomainUpDown control on run time using .net 2.0

Disclaimer - Privacy
© 2002-2017