I have 2 forms, let's say Form1 and Form2.
In Form1 there is a button, that shows Form2 when it's pressed, and a ListView.
In Form2 there is a textbox and a button. When the button is pressed, I want the text from the textbox to be added as an item in ListView in Form1.
private void button1_Click(object sender, EventArgs e)
{
ListViewItem item = new ListViewItem(textBox1.Text);
Form1.listView1.Items.Add(item);
}
I get error
"An object reference is required for the non-static field, method, or property 'project.Form1.listView1'
Any ideas?