WebBrowser.Stop Metoda

Definicja

Anuluje wszystkie oczekujące nawigacje i zatrzymuje wszystkie dynamiczne elementy strony, takie jak dźwięki tła i animacje.

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

Przykłady

W poniższym przykładzie kodu pokazano, jak za pomocą Stop metody zaimplementować przycisk Zatrzymaj dla WebBrowser kontrolki podobnej do tej w programie Internet Explorer. Ten przykład wymaga, aby formularz zawierał kontrolkę WebBrowser o nazwie webBrowser1 i kontrolkę Button o nazwie ButtonStop.

Pełny przykład kodu można znaleźć w temacie How to: Add Web Browser Capabilities to a Windows Forms Application (Instrukcje: dodawanie funkcji przeglądarki internetowej do aplikacji 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

Uwagi

Możesz użyć Stop metody , aby zaimplementować przycisk Zatrzymaj , który jest podobny do tego w menu Plik programu Internet Explorer.

Dotyczy

Zobacz też