I am currently working on a rather simple Windows Form that lets me type in information such as name and number into text fields and then add that to a list view. The information is entered in another Form and I had some issues figuring out how to access the listView
in Form1 from Form2.
I found the following code to work just fine
Form1:
private void button1_Click(object sender, System.EventArgs e)
{
Form2._Form1 = this;
Form2 form2 = new Form2();
form2.Show();
}
Form2:
public static Form1 _Form1;
Now, I simply wonder 2 things. What does this actually do? and do I HAVE to use static? Sorry if this is a very vague question, just wanna know what I'm actually doing.