当用户单击提交按钮时,我想将用户输入插入到数组中。这是我写的,但它似乎不起作用。该表单称为form1,它是它自己的类,文本框是textbox1。注意:我是编程新手。
//This is my array
private string[] texts = new string[10];
public string[] Texts
{
get { return texts; }
set { texts = value; }
}
//I then attempt to insert the value of the field into the textbox
form1 enterDetails = new form1();
for(int counter = 0; counter<Texts.Length; counter++)
{
texts[counter]=enterDetails.textbox1.Text;
}