2个回答
展开全部
先在Form2中设计一个传参方法:
public Label lb;
public void set(Label lb0)
{
lb = lb0;
}
private void button5_Click(object sender, EventArgs e)
{
lb.ForeColor = Color.Purple ;
lb.Font = new System.Drawing.Font("华文琥珀", 9, FontStyle.Bold);
lb.Text = this.textBox2.Text.ToString().Trim(); }
然后再From1中
private void button1_Click(object sender, EventArgs e)
{
Form2 d = new Form2();
d.set(label1);
d.Show();
}
这样就可以改变字体和颜色
public Label lb;
public void set(Label lb0)
{
lb = lb0;
}
private void button5_Click(object sender, EventArgs e)
{
lb.ForeColor = Color.Purple ;
lb.Font = new System.Drawing.Font("华文琥珀", 9, FontStyle.Bold);
lb.Text = this.textBox2.Text.ToString().Trim(); }
然后再From1中
private void button1_Click(object sender, EventArgs e)
{
Form2 d = new Form2();
d.set(label1);
d.Show();
}
这样就可以改变字体和颜色
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询