HtmlDocument.Stop 事件

定義

發生於另一個 Web 網頁的巡覽暫止時。

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

備註

如果程式碼呼叫 控制項的 WebBrowser 方法, Stop 則網頁的載入將會停止。 網路中斷或網站故障所造成的流覽失敗,不會造成 Stop 發生。

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

適用於

另請參閱