語言

WebBrowser.Stop 方法

定義

取消所有待處理的導覽,並停止所有動態頁面元素,如背景音效和動畫。

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

範例

以下程式碼範例示範如何使用 Stop 方法實作一個 Stop 按鈕,用於 WebBrowser 控制,類似於 Internet Explorer 中的按鈕。 這個範例要求你的形式包含WebBrowser一個名為 webBrowser1 的控制項和Button一個名為 的控制項。ButtonStop

完整程式碼範例請參見 如何:在Windows Forms應用程式中新增網頁瀏覽器功能。

// 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

備註

你可以使用 Stop 方法實作一個 Stop 按鈕,類似於 Internet Explorer File 選單中的按鈕。

適用於

另請參閱