I am using TextChanged event and when I am pressing keyboard, numbers are going into array… the question is:
When I am deleting any numbers I want to delete in the array list too
but cause of textchange event I already added an element I just want to delete the element and add another element
How do I do this?
long i;
long[] array1 = new long[11];
private void textBox1_TextChanged(object sender, EventArgs e)
{
try
{
array1[i] = long.Parse(textBox1.Text) % 10;
//MessageBox.Show(array1[i].ToString());
}
catch
{
if (i > 10)
{
//MessageBox.Show("it can be bigger than 11");
}
}
i++;
}
You can’t remove an element from the list. Use
List<T>collection.EDIT:
You may separate each digit of input text (Add textBox1 and listBox1 control):