you can use second form constructor.
private int input;
public Form2(int input)
{
this.input = input;
InitializeComponent();
}
when you create an object , you can pass your var(int in here):
int myvar=911;
Form2 tmp = new Form2(myvar);
tmp.Show();
now you can use that private variable in form2:
lbl.Text=input.toString();
in Form1:
private void button1_Click(object sender, EventArgs e)
{
Form2 tmp = new Form2(911);
tmp.Show();
}
and in Form2:
public Form2(int input)
{
InitializeComponent();
label1.Text = input.ToString();
}
send your code for solve this problem.i can't find out why it doesn't recognize your vars without your codes!