WebBrowser.StatusText 屬性

定義

取得 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

屬性值

狀態文字。

屬性

例外狀況

這個 WebBrowser 執行個體已不再有效。

無法從基礎 ActiveX IWebBrowser2 控制項中擷取 WebBrowser 介面實作的參考。

範例

下列程式碼範例示範如何使用 StatusText 屬性來實作類似 Internet Explorer 中控制項的狀態列 WebBrowser 。 此範例要求表單包含 WebBrowser 名為 的 webBrowser1 控制項,以及 StatusBar 稱為 的 StatusBar1 控制項。

如需完整的程式碼範例,請參閱如何:將網頁瀏覽器功能新增至 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

備註

您可以使用這個屬性,在狀態列中顯示控制項的狀態 WebBrowser 。 狀態文字是一則訊息,其中包含當滑鼠指標停留在超連結上以及目前載入之檔的 URL 等資訊。 StatusTextChanged處理事件,以在屬性值變更時 StatusText 更新狀態列。

適用於

另請參閱