title: InvalidArgument=Value of '0' is not valid for 'index' when trying to get only selected item in a ListView
body: <p>So I am trying to remove an item from a listview and a line from a text. I've used the SelectedItems[0] and it gives me an error. And yes I do have multiselect set to false.</p>
  <p>error log:</p>
  <pre><code> InvalidArgument=Value of '0' is not valid for 'index'.
  </code></pre>
  <p>my code:</p>
  <pre><code>        DialogResult msgBox = MessageBox.Show(&quot;Are you sure you want to remove this port?&quot;, &quot;Are you sure?&quot;, MessageBoxButtons.YesNo, MessageBoxIcon.Question);
  
          if (msgBox == DialogResult.No)
          {
              // Do nothing
          }
          if (msgBox == DialogResult.Yes) 
          {
              listView1.SelectedItems[0].Remove();
  
              StreamReader sr = File.OpenText(&quot;ports.cfg&quot;);
              string srStr = sr.ReadToEnd().ToString();
              sr.Close();
  
              List&lt;String&gt; linesList = File.ReadAllLines(&quot;ports.cfg&quot;).ToList();
              linesList.RemoveAt(listView1.SelectedItems[0].Index);
              File.WriteAllLines(&quot;ports.cfg&quot;, linesList);
              linesList.ToArray();
          }
  </code></pre>