110,533
社区成员
发帖
与我相关
我的任务
分享
InitializeComponent()函数中添加一个新的成员变量:
// new 一个状态条的Label
this.statusParameter = new System.Windows.Forms.ToolStripStatusLabel();
// 设置这个Label的属性
this.statusParameter.AutoSize = false;
this.statusParameter.BorderSides = System.Windows.Forms.ToolStripStatusLabelBorderSides.Left;
this.statusParameter.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
this.statusParameter.Name = "statusParameter";
this.statusParameter.Size = new System.Drawing.Size(200, 17);
this.statusParameter.Text = "算法参数:";
this.statusParameter.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
窗体类的构造函数中,将这个Label添加到状态栏。
this.statusMain.Items.Insert(1, this.statusParameter);
// 上面这句代码如果写到了InitializeComponent中,好像会被自动清除