StatusBar.Text Eigenschap
Definitie
Belangrijk
Bepaalde informatie heeft betrekking op een voorlopige productversie die aanzienlijk kan worden gewijzigd voordat deze wordt uitgebracht. Microsoft biedt geen enkele expliciete of impliciete garanties met betrekking tot de informatie die hier wordt verstrekt.
Hiermee haalt u de tekst op die aan het besturingselement is gekoppeld of stelt u deze StatusBar in.
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
Waarde van eigenschap
De tekst die aan het StatusBar besturingselement is gekoppeld.
Voorbeelden
In het volgende codevoorbeeld ziet u hoe u de Text eigenschap gebruikt. Als u het voorbeeld wilt uitvoeren, plakt u de volgende code in een formulier. Roep de InitializeSimpleStatusBar methode aan in de constructor of Load methode van het formulier.
// 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
Opmerkingen
Deze eigenschap vertegenwoordigt de tekst die wordt weergegeven door het besturingselement.
Caution
In StatusBar het besturingselement worden alleen de eerste 127 tekens van een tekenreeks weergegeven.