StatusBar::Text Property

 

Gets or sets the text associated with the StatusBar control.

Namespace:   System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

public:
property String^ Text {
	virtual String^ get() override;
	virtual void set(String^ value) override;
}

Property Value

Type: System::String^

The text associated with the StatusBar control.

This property represents the text displayed by the control.

System_CAPS_cautionCaution

The StatusBar control displays only the first 127 characters of a string.

The following code example demonstrates how to use the Text property. To run the example, paste the following code in a form. Call the InitializeSimpleStatusBar method in the form's constructor or Load method.

   // Initialize a single-panel status bar.  This is done
   // by setting the Text property and setting ShowPanels to False.
private:
   void InitializeSimpleStatusBar()
   {

      // Declare the StatusBar control
      StatusBar^ simpleStatusBar = gcnew StatusBar;

      // Set the ShowPanels property to False.
      simpleStatusBar->ShowPanels = false;

      // Set the text.
      simpleStatusBar->Text = "This is a single-panel status bar";

      // Set the width and anchor the StatusBar
      simpleStatusBar->Width = 200;
      simpleStatusBar->Anchor = AnchorStyles::Top;

      // Add the StatusBar to the form.
      this->Controls->Add( simpleStatusBar );
   }

.NET Framework
Available since 1.1
Return to top
Show: