I have an array with country names in a listBox. When I enter the textBox, I want any country that starts with what's in the textBox to display.
So if I enter : B => Brazil
Not like this: A => Argentina, England
Only if it starts with what's in the textBox. Full words would also work.
The arraylist contains more than just names, but the code below extracts just the names. List2 is the arraylist I want to use for the search.
private void textBox7_TextChanged(object sender, EventArgs e)
{
listBox1.ClearSelected();
listBox1.DataSource = null;
foreach (Country name2 in Mytree.List)
{
List2.Add(name2.name);
Console.WriteLine(List2);
}
}