StatusBar.Text Vlastnost

Definice

Získá nebo nastaví text přidružený k ovládacímu StatusBar prvku.

public:
 virtual property System::String ^ Text { System::String ^ get(); void set(System::String ^ value); };
public override string Text { get; set; }
member this.Text : string with get, set
Public Overrides Property Text As String

Hodnota vlastnosti

String

Text přidružený k ovládacímu StatusBar prvku.

Příklady

Následující příklad kódu ukazuje, jak použít Text vlastnost. Pokud chcete spustit příklad, vložte do formuláře následující kód. Volejte metodu InitializeSimpleStatusBar v konstruktoru nebo Load metodě formuláře.

   // 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 );
   }
// 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 = new 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);
}
' Initialize a single-panel status bar.  This is done
' by setting the Text property and setting ShowPanels to False.
Private Sub InitializeSimpleStatusBar()

    ' Declare the StatusBar control
    Dim simpleStatusBar As New 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.
    Me.Controls.Add(simpleStatusBar)

End Sub

Poznámky

Tato vlastnost představuje text zobrazený ovládacím prvku.

Upozornění

Ovládací StatusBar prvek zobrazí pouze prvních 127 znaků řetězce.

Platí pro