Condividi tramite


WebBrowser.StatusText Proprietà

Definizione

Ottiene il testo dello stato del WebBrowser controllo.

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 WebBrowser istanza non è più valida.

Impossibile 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 di 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 Form.

// 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 dello stato è un messaggio che contiene informazioni quali 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 viene modificato il valore della StatusText proprietà.

Si applica a

Vedi anche