StatusBar.Text Egenskap
Definition
Viktigt
En del information gäller för förhandsversionen av en produkt och kan komma att ändras avsevärt innan produkten blir allmänt tillgänglig. Microsoft lämnar inga garantier, uttryckliga eller underförstådda, avseende informationen som visas här.
Hämtar eller anger texten som är associerad med StatusBar kontrollen.
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
Egenskapsvärde
Texten som är associerad med StatusBar kontrollen.
Exempel
Följande kodexempel visar hur du använder egenskapen Text . Om du vill köra exemplet klistrar du in följande kod i ett formulär.
InitializeSimpleStatusBar Anropa metoden i formulärets konstruktor eller Load metod.
// 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
Kommentarer
Den här egenskapen representerar den text som visas av kontrollen.
Caution
Kontrollen StatusBar visar endast de första 127 tecknen i en sträng.