I have a two forms that I created using the design view of Visual C# Express (Form1 & infoEntry). I set the properties to of the listview in Form1.
public System.Windows.Forms.ListView toSend;
I've invoked the second form and sent some data using code below. Works great.
infoEntry dataWindow = new infoEntry();
dataWindow.filePath(selectedFile); \\sending some data to new form
dataWindow.ShowDialog();
I'm running into a problem when I attempt to send data back to Form1. The following code is within a button_Click
string patientid = (patientidSender.ToString());
string shift2 = (shift2Sender.ToString());
string[] row1 = { ("value1"), ("value2") };
Form1.toSend.Items.Add("test").SubItems.AddRange(row1); \\<--- this line causing the error.
The last line of code causes an error "An object reference is required for the non-static field"
But when I use that exact same line in the First Form (Form1) it doesn't seem to have a problem addind items. What can I do to fix this please? And thank you in advance.