C# Listbox Passing Strings
<p>I seem to have a problem passing some strings on from one form to another.
I have two listBoxes on Form1 but i want to use Form2 to pass the information on into the listBoxes in Form1.
In Form2 i have a button_Click function that calls a function in Form1 with params string a and string b.</p>

<pre><code>private void button_Click(object sender, EventArgs e){
Form1 frm = new Form1();
frm.AddItemToListBox(txtBox1.Text,txtBox2.Text);
}
</code></pre>

<p>Below is the code to call the function AddItemToListBox in Form1.<br>
Above is the function AddItemToListBox in Form1.</p>

<pre><code>AddItemToListBox(string a, string b){
listBox1.Items.Add(a);
listBox2.Items.Add(b);
}
</code></pre>

<p>However this does not add the strings into the listboxes. There are no error messages or anything.
I have also tried declaring 2 public strings STR1 and STR2</p>

<pre><code>AddItemToListBox(string a, string b){
listBox1.Items.Add(a);
listBox2.Items.Add(b);
STR1 = a;
STR2 = b;
}
</code></pre>

<p>But if i used a button that displays STR1 and STR2's value. They will be "", String.Empty. Nothing shows up in the MessageBox that displays the value. However, if i place the MessageBox.Show(a); and MessageBox.Show(b); in the AddItemToListBox function, the strings will be correctly shown but still not added to the listbox.</p>

<p>This has been frustrating me for like 2 hours now and i want to find out why and how to actually use that method to add an item to a listbox if its possible. Greatest thanks in advance.</p>
