Język

WebBrowser.Stop Metoda

Definicja

Anuluje wszelkie 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

Poniższy przykład kodu pokazuje, jak za pomocą metody Stop zaimplementować Stop przycisku WebBrowser podobnego do tego w Internet Explorer. Ten przykład wymaga, aby formularz zawierał kontrolkę WebBrowser o nazwie webBrowser1 i kontrolkę Button o nazwie ButtonStop.

Aby zapoznać się z kompletnym przykładem kodu, zobacz Jak dodać możliwości 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ć metody Stop, aby zaimplementować Stop przycisk podobny do tego w menu Internet Explorer File.

Dotyczy

Zobacz też