private void textBox1_KeyUp(object sender, KeyEventArgs e) { if (listView1.Items.Count > 0 && textBox1.Text.Trim() != string.Empty) { for (int i = 0; i < listView1.Items.Count; i++) { if (listView1.Items[i].SubItems[0].Text.IndexOf(textBox1.Text.Trim()) >= 0) { listView1.Items[i].Selected = true; listView1.Items[i].EnsureVisible(); } } } }
private void textBox1_KeyUp(object sender, KeyEventArgs e) { if (listView1.Items.Count > 0 && textBox1.Text.Trim() != string.Empty) { for (int i = 0; i < listView1.Items.Count; i++) { if (listView1.Items[i].SubItems[0].Text.IndexOf(textBox1.Text.Trim()) >= 0) { listView1.Items[i].Selected = true; listView1.Items[i].EnsureVisible(); } } } }