WebBrowser.Stop Method

Definition

Cancels any pending navigation and stops any dynamic page elements, such as background sounds and animations.

public:
 void Stop();
public void Stop ();
member this.Stop : unit -> unit
Public Sub Stop ()

Examples

The following code example demonstrates how to use the Stop method to implement a Stop button for the WebBrowser control similar to the one in Internet Explorer. This example requires that your form contains a WebBrowser control called webBrowser1 and a Button control called ButtonStop.

For the complete code example, see How to: Add Web Browser Capabilities to a Windows Forms Application.

// Halts the current navigation and any sounds or animations on 
// the page.
void ButtonStop_Click( System::Object^ /*sender*/, System::EventArgs^ /*e*/ )
{
   this->WebBrowser1->Stop();
}
// Halts the current navigation and any sounds or animations on 
// the page.
private void stopButton_Click(object sender, EventArgs e)
{
    webBrowser1.Stop();
}
' Halts the current navigation and any sounds or animations on 
' the page.
Private Sub stopButton_Click( _
    ByVal sender As Object, ByVal e As EventArgs) _
    Handles stopButton.Click

    webBrowser1.Stop()

End Sub

Remarks

You can use the Stop method to implement a Stop button that is similar to the one on the Internet Explorer File menu.

Applies to

See also