[英]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. 我想你正在寻找StatusStrip控件。 Here's an article about it . 这是一篇关于它的文章 。
And here's an MSDN article . 这是一篇MSDN文章 。
你的意思是像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. .NET确实包含状态栏。 You can find it under Menu & Toolbar . 您可以在菜单和工具栏下找到它。 It's called StatusStrip. 它叫做StatusStrip。
The control is called 'StatusStrip' and it is located in your toolbox. 该控件称为“StatusStrip”,它位于工具箱中。 If it isn't you can find it under the 'System.Windows.Forms" namespace. 如果不是,您可以在“System.Windows.Forms”命名空间下找到它。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.