how can i retrieve the total price only from this listbox and then total up in a textbox?? this is the code to add data to the listbox
Private Sub cbitem_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles cbitem.SelectedIndexChanged
If cbitem.SelectedIndex < 0 Then Return
Dim price = Convert.ToDecimal(items(cbitem.SelectedIndex, 1))
txtitemprice.Text = price
End Sub
Private Sub btnadd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnadd.Click
Dim price = Convert.ToDecimal(txtitemprice.Text)
Dim quantity = Convert.ToInt32(txtquantity.Text)
Dim totalprice As Integer = price * quantity
lstorder.Items.Add(cbitem.SelectedItem & vbTab & vbTab & vbTab & price & vbTab & vbTab & vbTab & quantity & vbTab & vbTab & totalprice)
End Sub
Suppose that you have two controls : ListBox1 and TextBox1.
For your work, you have to get the price of the current item and multiply it with it's quantity. Or you can sum each item of the totalPrice column.