簡體   English   中英

C#Windows窗體中的狀態欄

[英]Status bar in C# Windows Forms

我找不到用於實現狀態欄的控件。 我該如何手動完成?

我想你正在尋找StatusStrip控件。 是一篇關於它的文章

這是一篇MSDN文章

你的意思是像StatusStrip控件?

StatusStrip控件位於工具箱的“菜單和工具欄”類別中。

如果您想手動完成,請執行以下操作:

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確實包含狀態欄。 您可以在菜單和工具欄下找到它。 它叫做StatusStrip。

該控件稱為“StatusStrip”,它位於工具箱中。 如果不是,您可以在“System.Windows.Forms”命名空間下找到它。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM