title: How can I add information to a specific column and row in a listview?
body: <p><strong>The short version:</strong></p>
  
  <p>How can I add information to a specific column and row in a listview?</p>
  
  <p><strong>The longer version:</strong></p>
  
  <p>With some textboxes and buttons in another form I add items to my listview like this</p>
  
  <pre><code>        Dim li As ListViewItem
  
          li = Form1.ListView1.Items.Add("1")
          li.SubItems.Add(tbName1.Text)
          li.SubItems.Add(Form1.tbCount1.Text)
          li.SubItems.Add(tbType1.Text)
          li.SubItems.Add(Form1.tbStatus1.Text)
  
          Form1.ListView1.EndUpdate()
          Form1.ListView1.Refresh()
  </code></pre>
  
  <p>This is the output so far...</p>
  
  <p><a href="https://i.stack.imgur.com/fLOaR.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fLOaR.png" alt="enter image description here"></a></p>
  
  <p><code>Tbname1.text</code> (Column below <em>Channel</em>) and <code>tbtype1.text</code> (Column below <em>Type</em>) are specified in textboxes before i hit the button.</p>
  
  <p><code>Tbcount1.text</code> in form1 contains a number based on count of files within a folder. <code>TbStatus.text</code> is based on how many files there are. This count is hooked to another button (eventually a timer). This is why you'll notice Queue and Status is empty. </p>
  
  <p>Now if I'd hit that button (or timer) - lets say <code>btnUpdate</code> before the settings in my other form, it would look like this </p>
  
  <p><a href="https://i.stack.imgur.com/HDo7c.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/HDo7c.png" alt="enter image description here"></a></p>
  
  <p><strong>Here comes the problem...</strong></p>
  
  <p>I now want to update <strong>only</strong> the information under the column Queue (tbcount1.text) and Status (tbstatus.text) with <code>btnUpdate</code></p>
  
  <p>For example I have this counter</p>
  
  <pre><code>        If Form2.cbc1.Checked = True Then
          Try
              Dim fileTotal As Integer
              For Each item As String In lbChannel1.Items
                  fileTotal += My.Computer.FileSystem.GetFiles(item.ToString).Count
              Next
              tbCount1.Text = String.Format("{0}", fileTotal.ToString)
          Catch ex As Exception
              lbErrors.Items.Add(String.Concat("Error: ", ex.Message)) 'Error output
          End Try
          Dim tCount As Integer = 0
          'Til status
          If Val(tbCount1.Text) &gt; 20 Then
              tbStatus1.Text = ("Many files")
          Else
              tbStatus1.Text = ("Good")
          End If
      End If
  </code></pre>
  
  <p>Which works perfectly. It gives me the number and word I want in the two textboxes, but at the moment I have to refresh the whole listview to get that count-output into the columns. </p>
  
  <p><strong>I've tried...</strong></p>
  
  <p>To add this under the <code>btnUpdate</code>...</p>
  
  <pre><code>        Dim str(4) As String
      Dim itm As ListViewItem
  
      str(0) = ""
      str(1) = ""
      str(2) = (tbCount1.Text)
      str(3) = ""
      str(4) = (tbStatus1.Text)
  
      itm = New ListViewItem(str)
      ListView1.Items.Add(itm)
  </code></pre>
  
  <p>Sadly, this jumps to a second row. See image below.</p>
  
  <p><a href="https://i.stack.imgur.com/B6y3M.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/B6y3M.png" alt="enter image description here"></a></p>
  
  <p><strong>So here is what I want in other words:</strong> when <code>btnupdate</code> is pressed or a timer is at 100; update <em>specified row</em> - column 3 with <code>tbcount.text</code> and update <em>specified row</em> - column 5 with <code>tbstatus.text</code>. That wraps up my question. </p>
  
  <p>I found some information on this in C#, but I need it in VB.net. I might be close or far away. Hopefully it was understandable anyways. </p>