Getting errors when I am trying to save my inputs from textboxes to a list. I am using visual studio and a windows form application. What I want to do is to save the inputs from the textboxes to a list and then display the list in other forms. I have created one class with this code:
public class myClass
{
public List<customer> customerIdInfo= new List<customer>();
public class customer
{
string Id { get; set; }
int phoneNumber { get; set; }
string message { get; set; }
}
}
Then I have this in my form with the textboxes:
private void nextForm_Click(object sender, EventArgs e)
{
Form2 Form1= new Form2();
Form1.Show();
class myClass= new myClass();
customerIdInfo.Add(new customer{
Id = txtCustomerId.Text;
phoneNumber = txtPhonenumber.Text;
message = txtMessage.Text;
});
All the code in the form with the textboxes gets error messages anyone knowws how I can solve this problem?