简体   繁体   中英

Status bar in C# Windows Forms

I cannot find a control for implementing a status bar. How can I do it manually?

I think you're looking for the StatusStrip control. Here's an article about it .

And here's an MSDN article .

你的意思是像StatusStrip控件?

StatusStrip控件位于工具箱的“菜单和工具栏”类别中。

If you want to do it manually, here's what you will have to do:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WindowsFormsApplication1
{
  public partial class Form1 : Form
  {
    private System.Windows.Forms.StatusStrip statusStrip2;

    public Form1()
    {
      InitializeComponent();

      this.statusStrip2 = new System.Windows.Forms.StatusStrip();
      this.SuspendLayout();
      this.statusStrip2.Location = new System.Drawing.Point(0, 251);
      this.statusStrip2.Name = "statusStrip2";
      this.statusStrip2.Size = new System.Drawing.Size(292, 22);
      this.statusStrip2.TabIndex = 0;
      this.statusStrip2.Text = "statusStrip2";
      this.Controls.Add(this.statusStrip2);

      this.PerformLayout();
    }

  }
}

.NET does include a statusbar. You can find it under Menu & Toolbar . It's called StatusStrip.

The control is called 'StatusStrip' and it is located in your toolbox. If it isn't you can find it under the 'System.Windows.Forms" namespace.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM