suppose that u have two forms Form1 and Form2.......
and two variables 'a' and 'b' where 'a' belongs to Form1 and 'b' belongs to Form2... now if you want to pass value of 'a' to 'b' ........
1) write a constructor in Form2 like
public Form2(int value)
{
b = value;
}
2) Now instansiate the Form2 in Form1 by passing the value of "a" to the constructor like
Form2 f2 = new Form2(a); //in Form1
now you will have the value of 'a' as 'b' in Form2
suppose that u have two forms Form1 and Form2.......
and two variables 'a' and 'b' where 'a' belongs to Form1 and 'b' belongs to Form2... now if you want to pass value of 'a' to 'b' ........
1) write a constructor in Form2 like
public Form2(int value)
{
b = value;
}
2) Now instansiate the Form2 in Form1 by passing the value of "a" to the constructor like
Form2 f2 = new Form2(a); //in Form1
now you will have the value of 'a' as 'b' in Form2
Comment