title: vb.net listview equivalent to VB6 listindex
body: <p>I am trying to get the following VB6 listindex to work within my vb.net code:</p>
  
  <pre><code>setTheR CStr(payReq.ItemData(payReq.ListIndex))
  </code></pre>
  
  <p>But if i copy and paste that into VB.net it wont accept it.</p>
  
  <p>This is what VB.net did with the converting of the VB6 to .net code:</p>
  
  <pre><code>strContract = payReq.Items.Item(payReq.FocusedItem.Index).Text
  </code></pre>
  
  <p>However, checking that value it returns the name instead of the index. While the VB6 code returns the value of 2311 (which is what it needs to return)</p>
  
  <p>When i add items to the listview i do this:</p>
  
  <pre><code>Item = payReq.Items.Add(rsPayRequests.Fields("userid").Value)
  Item.SubItems.Insert(1, New System.Windows.Forms.ListViewItem.ListViewSubItem(Nothing,   VB6.Format(rsPayRequests.Fields("reqdatetime").Value, "mm/dd/yyyy")))
  </code></pre>
  
  <p>But i noticed it does this as well:</p>
  
  <pre><code>payReq.Items.Add(New VB6.ListBoxItem(Item, rsPayRequests.Fields("requestNum").Value))
  </code></pre>
  
  <p>But that does not work with my listview in .net since that above is a listbox and not a listview. Is there an equivalent in .net for the listbox to have a custom index?</p>
  
  <p>Any help would be great!</p>
  
  <p>David</p>