WebBrowser.StatusText Proprietà

Definizione

Ottiene il testo dello stato del controllo WebBrowser.

public:
 virtual property System::String ^ StatusText { System::String ^ get(); };
[System.ComponentModel.Browsable(false)]
public virtual string StatusText { get; }
[<System.ComponentModel.Browsable(false)>]
member this.StatusText : string
Public Overridable ReadOnly Property StatusText As String

Valore della proprietà

Testo dello stato.

Attributi

Eccezioni

Questa istanza di WebBrowser non è più valida.

Non è stato possibile recuperare un riferimento a un'implementazione dell'interfaccia IWebBrowser2 dal controllo ActiveX WebBrowser sottostante.

Esempio

Nell'esempio di codice seguente viene illustrato come utilizzare la StatusText proprietà per implementare una barra di stato per il WebBrowser controllo simile a quella in Internet Explorer. In questo esempio è necessario che il form contenga un WebBrowser controllo denominato webBrowser1 e un StatusBar controllo denominato StatusBar1.

Per l'esempio di codice completo, vedere Procedura: Aggiungere funzionalità del Web browser a un'applicazione Windows Forms.

// Updates StatusBar1 with the current browser status text.
void WebBrowser1_StatusTextChanged( Object^ /*sender*/, System::EventArgs^ /*e*/ )
{
   this->StatusBar1->Text = WebBrowser1->StatusText;
}
// Updates the status bar with the current browser status text.
private void webBrowser1_StatusTextChanged(object sender, EventArgs e)
{
    toolStripStatusLabel1.Text = webBrowser1.StatusText;
}
' Updates the status bar with the current browser status text.
Private Sub webBrowser1_StatusTextChanged( _
    ByVal sender As Object, ByVal e As EventArgs) _
    Handles webBrowser1.StatusTextChanged

    toolStripStatusLabel1.Text = webBrowser1.StatusText

End Sub

Commenti

È possibile utilizzare questa proprietà per visualizzare lo stato del WebBrowser controllo in una barra di stato. Il testo di stato è un messaggio che contiene informazioni come l'URL di un collegamento ipertestuale quando il puntatore del mouse passa il puntatore del mouse su di esso e l'URL del documento attualmente in fase di caricamento. Gestire l'evento StatusTextChanged per aggiornare la barra di stato quando il valore della StatusText proprietà viene modificato.

Si applica a

Vedi anche