HtmlDocument.Stop Event
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Occurs when navigation to another Web page is halted.
public:
event System::Windows::Forms::HtmlElementEventHandler ^ Stop;
public event System.Windows.Forms.HtmlElementEventHandler Stop;
public event System.Windows.Forms.HtmlElementEventHandler? Stop;
member this.Stop : System.Windows.Forms.HtmlElementEventHandler
Public Custom Event Stop As HtmlElementEventHandler
Event Type
Examples
The following code example resets the status bar on a Windows Forms application when the Stop
event has occurred. The code example requires that you have a StatusBar control named StatusBar1
in your application.
ContextMenuStrip menuStrip = null;
public void DetectContextMenu()
{
if (webBrowser1.Document != null)
{
webBrowser1.Document.ContextMenuShowing += new HtmlElementEventHandler(Document_ContextMenuShowing);
menuStrip = new ContextMenuStrip();
menuStrip.Items.Add("&Custom menu item...");
}
}
void Document_ContextMenuShowing(object sender, HtmlElementEventArgs e)
{
menuStrip.Show(e.MousePosition);
e.ReturnValue = false;
}
Remarks
The loading of a Web page will halt if program code calls the Stop method of the WebBrowser control. Navigation failures caused by network outages or malfunctioning Web sites will not cause Stop to occur.
For more information about handling events, see Handling and Raising Events.