StatusBar.Text Propiedad
Definición
Importante
Parte de la información hace referencia a la versión preliminar del producto, que puede haberse modificado sustancialmente antes de lanzar la versión definitiva. Microsoft no otorga ninguna garantía, explícita o implícita, con respecto a la información proporcionada aquí.
Obtiene o establece el texto asociado al StatusBar control .
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
Valor de propiedad
Texto asociado al StatusBar control .
Ejemplos
En el ejemplo de código siguiente se muestra cómo usar la Text propiedad . Para ejecutar el ejemplo, pegue el código siguiente en un formulario. Llame al InitializeSimpleStatusBar método en el constructor o Load método del formulario.
// 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
Comentarios
Esta propiedad representa el texto mostrado por el control .
Precaución
El StatusBar control muestra solo los primeros 127 caracteres de una cadena.