【问题标题】:Status bar in C# Windows FormsC# Windows 窗体中的状态栏
【发布时间】:2009-06-09 12:21:53
【问题描述】:

我找不到用于实现状态栏的控件。如何手动完成?

【问题讨论】:

    标签: c# winforms


    【解决方案1】:

    我认为您正在寻找 StatusStrip 控件。这里是an article about it

    这是一个MSDN article

    【讨论】:

      【解决方案2】:

      如果您想手动操作,请执行以下操作:

      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();
          }
      
        }
      }
      

      【讨论】:

      • 别忘了Dock到底!
      • @Yadyn。默认情况下,StatusStrip 的 Dock 属性设置为 Bottom。
      【解决方案3】:

      您的意思是类似于StatusStrip 控件?

      【讨论】:

        【解决方案4】:

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

        【讨论】:

          【解决方案5】:

          该控件名为“StatusStrip”,位于您的工具箱中。如果不是,您可以在“System.Windows.Forms”命名空间下找到它。

          【讨论】:

            【解决方案6】:

            .NET 确实包含状态栏。您可以在菜单和工具栏下找到它。它被称为 StatusStrip。

            【讨论】:

              猜你喜欢
              • 1970-01-01
              • 1970-01-01
              • 1970-01-01
              • 2021-06-20
              • 2014-04-09
              • 1970-01-01
              • 1970-01-01
              • 1970-01-01
              • 1970-01-01
              相关资源
              最近更新 更多