
private void button1_Click(object sender, EventArgs e) //登陆页面的第一栏的文本 要将它传到Main窗体的状态栏
{ //要通过构造函数传值
string x = textBox1.Text;
Main f = new Main(x); //构造函数传值
f.Show();
}
private string X;
public Main(string x)
{
InitializeComponent();
X = x; //开始传值
}
private void Main_Load(object sender, EventArgs e)
{
toolStripStatusLabel1.Text = "欢迎您:" + X; // 在加载Main页面的时间 把状态栏加载出来
}
原文:http://www.cnblogs.com/w-wz/p/4562165.html