WebBrowser.Stop Method

Definition

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

C#
public void 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.

C#
// Halts the current navigation and any sounds or animations on 
// the page.
private void stopButton_Click(object sender, EventArgs e)
{
    webBrowser1.Stop();
}

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

Product Versions
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

See also