HtmlDocument.Stop 事件

定義

當導覽到另一個網頁時會發生。

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 

事件類型

範例

以下程式碼範例會在發生 Stop 事件時,重設 Windows Forms 應用程式的狀態列。 程式碼範例要求你在應用程式中有一個 StatusBar 控制項名稱 StatusBar1

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;
}

備註

若程式代碼呼叫 Stop 控制項的方法 WebBrowser ,網頁載入將停止。 由於網路中斷或網站故障所導致的導航失效,則不會因此 Stop 發生。

如需處理事件的詳細資訊,請參閱 處理和引發事件

適用於

另請參閱