Diferencia entre revisiones de «Interfaces Gráficas de Usuario/Status Bars»

Contenido eliminado Contenido añadido
Andrs95 (discusión | contribs.)
Andrs95 (discusión | contribs.)
Línea 32:
private void CreateMyStatusBar()
{
// CreateCrear a StatusBarun control StatusBar.
StatusBar statusBar1 = new StatusBar();
// CreateCree twodos StatusBarPanelobjetos objectsStatusBarPanel topara displaymostrar inen thela StatusBar.
StatusBarPanel panel1 = new StatusBarPanel();
StatusBarPanel panel2 = new StatusBarPanel();
 
// DisplayMuestra theel firstprimer panel withcon aun sunkenestilo borderde styleborde hundido.
panel1.BorderStyle = StatusBarPanelBorderStyle.Sunken;
// InitializeInicializar theel texttexto of thedel panel.
panel1.Text = "Ready...";
// SetEstablezca thela AutoSizepropiedad propertyAutoSize toutilizar usetodo allel remainingespacio spacerestante onen thela StatusBar.
panel1.AutoSize = StatusBarPanelAutoSize.Spring;
// DisplayMuestra theel secondsegundo panel withcon aun raisedestilo borderde styleborde levantado.
panel2.BorderStyle = StatusBarPanelBorderStyle.Raised;
// Crear texto de información sobre herramientas que muestra la hora en que se inició la aplicación.
// Create ToolTip text that displays time the application was
//started.
panel2.ToolTipText = "Started: " + System.DateTime.Now.ToShortTimeString();
// SetEstablezca theel texttexto ofde thela panelpantalla toa thela currentfecha dateactual.
panel2.Text = System.DateTime.Today.ToLongDateString();
// SetEstablecer thela propiedad AutoSize propertyen toel sizetamaño thedel panel to theal sizetamaño ofde thelos contentscontenidos.
panel2.AutoSize = StatusBarPanelAutoSize.Contents;
// DisplayMuestra panelslos inpaneles theen StatusBarel control StatusBar.
statusBar1.ShowPanels = true;
 
// AddAñadir bothlos panelsdos topaneles thea la StatusBarPanelCollection ofde thela StatusBar.
statusBar1.Panels.Add(panel1);
statusBar1.Panels.Add(panel2);
 
// AddAñadir thela StatusBar toal the formformulario.
this.Controls.Add(statusBar1);
}