请问状态栏这个控件怎么用啊

xyjchinese 2006-11-30 09:50:11
请问状态栏这个控件怎么用啊,我已经托到form里了,可是不会用,不知道怎么写,给我个小例子就行了,平台C#2005
...全文
218 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
xyjchinese 2006-12-01
  • 打赏
  • 举报
回复
msdn里的那个例子我看不懂,帮忙说说怎么用StatusStrip这个状态栏控件
kings23 2006-12-01
  • 打赏
  • 举报
回复
MSDN是好东西
dyw31415926 2006-12-01
  • 打赏
  • 举报
回复
估计楼主只是用做简单用途的,那好办
public Form1()
{
InitializeComponent();
StatusStrip statusStrip1 = new System.Windows.Forms.StatusStrip();
ToolStripStatusLabel toolStripStatusLabel1 = new System.Windows.Forms.ToolStripStatusLabel();
//
// statusStrip1
//
statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
toolStripStatusLabel1});
statusStrip1.Location = new System.Drawing.Point(0, 244);
statusStrip1.Name = "statusStrip1";
statusStrip1.Size = new System.Drawing.Size(292, 22);
statusStrip1.TabIndex = 2;
statusStrip1.Text = "statusStrip1";
statusStrip1.ItemClicked += new System.Windows.Forms.ToolStripItemClickedEventHandler(this.statusStrip1_ItemClicked);
//
// toolStripStatusLabel1
//
toolStripStatusLabel1.Name = "toolStripStatusLabel1";
toolStripStatusLabel1.Size = new System.Drawing.Size(131, 17);
toolStripStatusLabel1.Text = "toolStripStatusLabel1";
toolStripStatusLabel1.Text = "你要显示的内容";

this.Controls.Add(statusStrip1);
}

----------------------------------------
toolStripStatusLabel1.Text = "你要显示的内容";
liujia_0421 2006-11-30
  • 打赏
  • 举报
回复
MSDN上的例子,不过不是拖的,动态生成的,意思应该差不多...

自己看下,或者看下MSDN吧,上面讲得也很清楚了..

using System;
using System.Text;
using System.Windows.Forms;

namespace WindowsApplication4
{
public class Form1 : Form
{
private StatusStrip statusStrip1;
private ToolStripStatusLabel toolStripStatusLabel1;

public Form1()
{
InitializeComponent();
}
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.Run(new Form1());
}

private void InitializeComponent()
{
statusStrip1 = new System.Windows.Forms.StatusStrip();
toolStripStatusLabel1 = new System.Windows.Forms.ToolStripStatusLabel();
statusStrip1.SuspendLayout();
SuspendLayout();
//
// The following code example demonstrates the syntax for setting
// various StatusStrip properties.
statusStrip1.Dock = System.Windows.Forms.DockStyle.Top;
statusStrip1.GripStyle = System.Windows.Forms.ToolStripGripStyle.Visible;
statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
toolStripStatusLabel1});
statusStrip1.LayoutStyle = System.Windows.Forms.ToolStripLayoutStyle.HorizontalStackWithOverflow;
statusStrip1.Location = new System.Drawing.Point(0, 0);
statusStrip1.Name = "statusStrip1";
statusStrip1.ShowItemToolTips = true;
statusStrip1.Size = new System.Drawing.Size(292, 22);
statusStrip1.SizingGrip = false;
statusStrip1.Stretch = false;
statusStrip1.TabIndex = 0;
statusStrip1.Text = "statusStrip1";
//
// toolStripStatusLabel1
//
toolStripStatusLabel1.Name = "toolStripStatusLabel1";
toolStripStatusLabel1.Size = new System.Drawing.Size(109, 17);
toolStripStatusLabel1.Text = "toolStripStatusLabel1";
//
// Form1
//
ClientSize = new System.Drawing.Size(292, 273);
Controls.Add(statusStrip1);
Name = "Form1";
statusStrip1.ResumeLayout(false);
statusStrip1.PerformLayout();
ResumeLayout(false);
PerformLayout();

}
}
}

111,119

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • AIGC Browser
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧