Прочетете на английски Редактиране

Споделяне чрез


WebBrowser.StatusText Property

Definition

Gets the status text of the WebBrowser control.

C#
[System.ComponentModel.Browsable(false)]
public virtual string StatusText { get; }

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.

C#
// Updates the status bar with the current browser status text.
private void webBrowser1_StatusTextChanged(object sender, EventArgs e)
{
    toolStripStatusLabel1.Text = webBrowser1.StatusText;
}

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

Продукт Версии
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

See also