title: Advanced searching listview
body: <p>My search button now allows normal searching within the listView. It does not allow me to search by showing the "exact match" that is typed in the textBox without including the rest of the contents. </p>
  
  <pre><code>private void SearchBtn_Click(object sender, EventArgs e)
  {
      int count = 0, searchStartIndex = 0;
      // Clear previously selected indices
      listView.SelectedIndices.Clear();
      string target = searchTextBox.Text;
      // Search for item with text from the search text box, including subItems, from searchStartIndex, not a prefixSearch
      ListViewItem item = listView.FindItemWithText(target, true, searchStartIndex, false);
      while (item != null)
      {
          count++;
          // Update progressBar
          progressBar.Value = (int)((float)searchStartIndex / listView.VirtualListSize * 100);
          ListView.SelectedIndexCollection indexes = listView.SelectedIndices;
          if (!indexes.Contains(item.Index))
          {
              listView.SelectedIndices.Add(item.Index);
          }
          if ((searchStartIndex = item.Index + 1) &lt; listView.VirtualListSize)
          {
              item = listView.FindItemWithText(searchTextBox.Text, true, searchStartIndex, false);
              //  count++;
          }
          else
          {
              item = null;
          }
      }
      if (listView.SelectedIndices.Count == 0)
      {
          MessageBox.Show("Find item with text \"" + searchTextBox.Text + "\" has no result.");
      }
      else
      {
          RefilterListView();
          listView.EnsureVisible(listView.SelectedIndices[0]);
      }
      // Reset focus on the listView so the user can see the selected indices
      listView.Focus();
      // Update searchLabel with count of number found
      searchLabel.Text = "" + count + " results found";
  }
  </code></pre>
  
  <p>I expect to be able to search by using two radio buttons: "show match" which will only show the searched item(s) and "show no match" which will only show items not related to search item(s).</p>