Alternatively to passing the value by Form2 constructor, you can create a property that sets the label value, e.g.
Form2
public partial class Form2 : Form
{
public Form2()
{
InitializeComponent();
}
public int XValue{
set{
label1.Text = value.ToString();
}
}
}
Form1
public partial class Form1 : Form
{
private int x = 10;
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
Form2 form2 = new Form2();
form2.XValue = x;
form2.Show();
}
}