title: Loop Through Listview Checked Items
body: <p>In regards to my <a href="https://stackoverflow.com/questions/32025084/c-sharp-sms-sender-thru-modem">previous post</a> about sending SMS, I am having trouble sending the message to all selected items in the listview via checkbox.</p>
  
  <p>The message will be sent to their mobile numbers which is subitem1 in the listview.</p>
  
  <p>Here's my code for sending the message.</p>
  
  <pre><code>foreach (ListViewItem eachItem in lvNumbers.SelectedItems)
  {
       //string Selected = eachItem.Text;
       string Selected =  lvNumbers.Items[Convert.ToString(eachItem)].SubItems[1].Text;
       sm.sendSMS(Selected, txtMessage.Text);
  }
  
  sm.Closes();
  MessageBox.Show("Messages Sent!");
  </code></pre>
  
  <p>What Am I missing.</p>
  
  <p>Here's a screenshot of the program.</p>
  
  <p><a href="https://i.stack.imgur.com/vKX2b.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/vKX2b.png" alt="enter image description here"></a></p>