WebBrowser.Stop 方法

定義

取消任何暫止的巡覽,並停止任何動態頁面項目 (例如背景聲音和動畫)。

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

範例

下列程式碼範例示範如何使用 Stop 方法來實作類似 Internet Explorer 中控制項的 [停止] 按鈕 WebBrowser 。 此範例會要求表單包含 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 方法來實作類似 Internet Explorer檔案功能表上的[停止]按鈕。

適用於

另請參閱