Advertisement
Guest User

JABVIR

a guest
Jun 20th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. if (txt_Search.Text != "")
  2. {
  3. foreach (ListViewItem item in listView1.Items)
  4. {
  5. if (item.Text.ToLower().Contains(txt_Search.Text.ToLower()))
  6. {
  7. item.Selected = true;
  8. }
  9. else
  10. {
  11. listView1.Items.Remove(item);
  12. }
  13.  
  14. }
  15. if (listView1.SelectedItems.Count == 1)
  16. {
  17. listView1.Focus();
  18. }
  19. }
  20. else
  21. {
  22. LoadContacts();
  23. RefreshAll();
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement