Set Text to Statusbar : StatusBar « GUI Windows Form « C# / C Sharp






Set Text to Statusbar

 


using System;
using System.Drawing;
using System.Windows.Forms;
   
class SimpleStatusBar: Form
{
     public static void Main()
     {
          Application.Run(new SimpleStatusBar());
     }
     public SimpleStatusBar()
     {
          Text = "Simple Status Bar";
          ResizeRedraw = true;
   
          StatusBar sb = new StatusBar();
          sb.Parent = this;
          sb.Text = "My initial status bar text";
     }
     protected override void OnPaint(PaintEventArgs pea)
     {
          Graphics grfx = pea.Graphics;
          Pen      pen  = new Pen(ForeColor);
   
          grfx.DrawLine(pen, 0, 0, ClientSize.Width, ClientSize.Height);
          grfx.DrawLine(pen, ClientSize.Width, 0, 0, ClientSize.Height);
     }
}

 








Related examples in the same category

1.Display message in StatusBar
2.Use Label as status barUse Label as status bar
3.Add icon to statusbarAdd icon to statusbar
4.Display current time on statusbarDisplay current time on statusbar
5.Display menu item alert message on the statusbarDisplay menu item alert message on the statusbar
6.StatusBar with two panelsStatusBar with two panels
7.Status bar: display time and prompt message for menu itemStatus bar: display time and prompt message for menu item
8.StatusBar ExampleStatusBar Example
9.Status Strip Example
10.Use StatusBarPanel
11.Add StatusPanels to StatusBar