How to take a string value from a textbox and store it in an array string? Upon click of the summary button, it displays the array as a list in the list box.
For example, User enters "Tom" in the textbox. Hits Enter! Tom is stored in the array The user enters "Nick" in the textbox and Hits Enter! Nick is stored in the array and so on.
Finally, when the user hits the summary button, the List box displays something like:
Tom
Nick
Can someone help me with this? Much appreciated thank you!
This is my code so far
//Button helps to display the total number of customers
private void viewCustomerSBtn_Click(object sender, EventArgs e)
{
//Displays the string of names that are stored in cNames
//Creates an array to hold Customer Names
string[] cNames = new string[100];
for (int i = 0; i < cNames.Length; i++)
{
cNames[i] = nameTextBox.Text;
reportListBox.Items.Add(cNames[i]);
}
