title: How can i do the total of price column in listview using visual basic
body: <p>The code currently i posted have listview related code only.I am having three columns
  'Item', 'Quantity', 'Price' and i am having trouble doing total of price column only.
  The thing i want to do is like when i click on Total button it should calculate all the price entered and display the total in a textbox.</p>
  
  <p>I am a beginner and learning visual basic so i don't know much about it.</p>
  
  <p>So Please help me.</p>
  
  <p>Here is my code,</p>
  
  <pre><code> Public Class marutiselection
  
  'handles Add Item Button's Click event
  
  Private Sub addButton_Click(ByVal sender As System.Object, _
     ByVal e As System.EventArgs) Handles addButton.Click
  
      'clear previous bill totals and calculation result
  
      If totalcostResultLabel.Text &lt;&gt; "" Then
          totalcostResultLabel.Text = ""
      End If
  
      Dim lstitm As ListViewIte
  
      lstitm = ListView1.Items.Add(ComboBox1.Text)
      lstitm.SubItems.Add(quantityTextBox.Text)
      lstitm.SubItems.Add(priceTextBox.Text)
      quantityTextBox.Clear() ' clear quantity from TextBox
      quantityTextBox.Focus() ' transfer focus to TextBox
      ComboBox1.Text = String.Empty ' clear menu item from TextBox
      ComboBox1.Focus() ' transfer focus to TextBox
      priceTextBox.Clear() ' clear price from TextBox
      priceTextBox.Focus() ' transfer focus to TextBox
  
  End Sub
  
      Private Sub totalbillButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) 
      Handles totalbillButton.Click
  
              Const col As Integer = 3
              Dim total As Integer = 0
              Dim lvsi As ListViewItem.ListViewSubItem
  
                  For i As Integer = 0 To ListView1.Items.Count - 1
  
                  lvsi = ListView1.Items(i).SubItems(col)
                  total += Integer.Parse(lvsi.Text)
  
                  Next
  
                  totalcostResultLabel.Text = total
  
     End Sub
  
       Private Sub marutiselection_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) 
       Handles MyBase.Load
  
                 Dat.Text = DateTime.Now.ToShortDateString()
                 Timer1.Start()
                 Call CenterToScreen()
                 Me.WindowState = FormWindowState.Maximized
  
                  ListView1.Columns.Add("Item", 130, HorizontalAlignment.Left)
                  ListView1.Columns.Add("Quantity", 100, HorizontalAlignment.Right)
                  ListView1.Columns.Add("Price", 75, HorizontalAlignment.Right)
                  ListView1.Items.Add(New ListViewItem(""))
  
      End Sub
    End Class
  </code></pre>