I have been searching and trying a few thing but no luck
I have 2 forms, Form 1 has a listview and Form2 searches for an item, if the item in Form2 is found I want to add it to the listview in form1
Note Form2 Launches on a button click from Form1
Form1 (name is MainScreen):
// Add item from the add item dialog
public void AddFromItemDialog(ListViewItem itms)
{
listItems.Items.Add(itms);
}
Form2 ():
private void btnAdd_Click(object sender, EventArgs e)
{
MainScreen mainScreen = new MainScreen();
MessageBox.Show("Item Added!");
ListViewItem lvi = new ListViewItem();
lvi.Text = "Item 1";
lvi.SubItems.Add("Second Item");
mainScreen.AddFromItemDialog(lvi);
}
There are no errors but nothing gets added to the listview in form 1