C# Windows 窗体中的状态栏
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/969755/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Status bar in C# Windows Forms
提问by
I cannot find a control for implementing a status bar. How can I do it manually?
我找不到用于实现状态栏的控件。我该如何手动完成?
回答by Joseph
I think you're looking for the StatusStrip control. Here's an article about it.
我认为您正在寻找 StatusStrip 控件。这是一篇关于它的文章。
And here's an MSDN article.
这是一篇MSDN 文章。
回答by Michael Klement
You mean something like the StatusStripcontrol?
你的意思是像StatusStrip控件?
回答by Ikke
.NET does include a statusbar. You can find it under Menu & Toolbar. It's called StatusStrip.
.NET 确实包含一个状态栏。您可以在Menu & Toolbar下找到它。它被称为状态条。
回答by sgmeyer
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.
该控件称为“StatusStrip”,它位于您的工具箱中。如果不是,您可以在“System.Windows.Forms”命名空间下找到它。
回答by Joey
There is the StatusStrip
control, found in the "Menus & Toolbars" category in the toolbox.
有一个StatusStrip
控件,可以在工具箱的“菜单和工具栏”类别中找到。
回答by Magnus Johansson
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();
}
}
}