I have a form with a button, when the button is clicked, the [public int m = 0]
changes 1. I have another form [form2]
, when I make a new class from form1
to get m
value, it passes 0
and I don't know why.
public partial class Form1 : Form
{
public int m =0;
private void button1_Click(object sender, EventArgs e)
{
m = 1;
}
}
public partial class Form2 : Form
{
Form2 form2_new = new Form2();
// methods to get m ---------> it should be 1 but I get 0!!!!
}