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
 

Refresh” and”Stop” in Web Browser Control Application using C# .net 2.0

Author: Zunnair
Download Source Code : 818_refresh stop.zip

In this simple article you will learn that how to make “Refresh” and ”Stop” buttons in Web Browser Application (Web Browser Control Application)

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

·         One button will use for loading page which I have discuss in one of my previous articles.

·         Other two buttons will be used to load home page and refresh the existing page.

Now write the following code on Form Load event:

C#

private void LoadForm_Browser(object sender, EventArgs e)

        {

            this.Text = "DevAsp WebBrowser Application";

            this.txt_Url.Text = "www.devasp.net";

            wbBrwsr.Navigate(txt_Url.Text);

        }

VB

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

        Me.Text = "DevAsp WebBrowser Application"

        Me.txt_Url.Text = "www.devasp.net"

        wbBrwsr.Navigate(txt_Url.Text)

    End Sub

Now write the following code on button click event:

For Refresh button:

C#

private void btn_refresh_Click(object sender, EventArgs e)

        {

            wbBrwsr.Refresh();

        }

VB

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

        wbBrwsr.Refresh()

    End Sub

For Stop button:

C#

private void btn_stop_Click(object sender, EventArgs e)

        {

            wbBrwsr.Stop();

        }

VB

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

        wbBrwsr.[Stop]()

    End Sub

 

This is the simple code for adding refresh and stop buttons in web Browser control application.

   
Add Article Comment:
Name :
Email Address :
   
Comments :
 
   
<< Font Dialog component (control) in C# .net 2.0

Disclaimer - Privacy
© 2002-2017 DevASP.net