private void comboboxPerson2_KeyPress_1(object sender, KeyPressEventArgs e)
{
if (e.KeyChar == (char)Keys.Enter)
{
p2.Name = comboboxPerson2.Text;
var fine = new List<Person>();
string compare = comboboxPerson2.Text.ToUpper();
foreach (Person p in people)
{
if (p.Name.Contains(compare))
{
fine.Add(p);
}
}
comboboxPerson2.DataSource = fine;
comboboxPerson2.DisplayMember = Name;
comboboxPerson2.SelectedIndex = 0;
}
}