事情是这样的,我在用C#开发winform程序,现在想在状态栏上显示几行文字,但是我发现我使用了statuestrip空间以后,他那个最后一个toolstatuestrip无法正常显示,我也不知道是哪里出现了错误,关于spring属性我都设置的是true,bordersize我也是none,下面是我的代码
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace WindowsFormsApp1
{
public partial class user1 : Form
{
public user1()
{
InitializeComponent();
}
private void label1_Click(object sender, EventArgs e)
{
}
private void timer1_Tick(object sender, EventArgs e)
{
this.label2.Text = DateTime.Now.ToString();
}
private void label2_Click(object sender, EventArgs e)
{
}
private void user1_Load(object sender, EventArgs e)
{
this.toolStripStatusLabel1.Text = "欢迎您!同学";
this.toolStripStatusLabel2.Text = "本次登录时间戳为:" + DateTime.Now.ToString();
this.toolStripStatusLabel3.Text = "系统版本V1.0.1";
}
private void toolStripStatusLabel1_Click(object sender, EventArgs e)
{
}
private void toolStripStatusLabel2_Click(object sender, EventArgs e)
{
}
private void toolStripStatusLabel3_Click(object sender, EventArgs e)
{
}
}
}
三个tool控件可以正常显示
用你的代码测了没什么问题,建议在赋值语句那边加断点调试看一下。
代码看起来没有问题,加载的时候给这个控件赋值,你可以F9打个断点进去调式一下看下。就知道问题出在哪里了。