You should not use anything from your ToolBox...
Use a
List[
^], or rather anything that Implements
IList[
^], just what meets your wishes.
It requires some knowledge of
Generics[
^] though. But once you get it you can simply do something like the following:
List<string> names = new List<String>();
names.Add("John");
names.Add("Doe");
private List<String> _names
private void Button1_Click(Object sender, EventArgs e)
{
if _names is null
_names = new List<String>();
names.Add(TextBox1.Text);
}
foreach (String name in _names)
Console.WriteLine(name);
That code basically says you have a list of strings which you add names to.
You then check every name in the list and write them to the console (or anything you like).
To store more complex data you can use
Classes
.