Επεξεργασία

Κοινή χρήση μέσω


WebBrowser.StatusText Property

Definition

Gets the status text of the WebBrowser control.

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

Property Value

The status text.

Attributes

Exceptions

This WebBrowser instance is no longer valid.

A reference to an implementation of the IWebBrowser2 interface could not be retrieved from the underlying ActiveX WebBrowser control.

Examples

The following code example demonstrates how to use the StatusText property to implement a status bar for the WebBrowser control similar to the one in Internet Explorer. This example requires that your form contains a WebBrowser control called webBrowser1 and a StatusBar control called StatusBar1.

For the complete code example, see How to: Add Web Browser Capabilities to a Windows Forms Application.

// 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

Remarks

You can use this property to display the status of the WebBrowser control in a status bar. The status text is a message that contains information such as the URL of a hyperlink when the mouse pointer hovers over it and the URL of the document currently being loaded. Handle the StatusTextChanged event to update the status bar when the value of the StatusText property changes.

Applies to

See also