Hi.
I'm just building a simple order calculator in which my list boxes track the orders that have been placed. There are 3 separate list boxes; one for the meal, another for the number of items and the cost of those items. I have set up so that when an item is deleted it removes it from the list box but what I can't get it to do is take the value that is in the list box away from a total that gets printed when the total button is pressed.
Here's the delete code I'm currently running:
Private Sub BtnDelete_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnDelete.Click
Dim Selection As Integer
Selection = LstBxMeal.SelectedIndex
If Selection > 0 Then
TotalItems = TotalItems - LstBxItems.GetItemText(Selection)
TotalCost = TotalCost - LstBxCost.GetItemText(Selection)
LstBxMeal.Items.RemoveAt(Selection)
LstBxItems.Items.RemoveAt(Selection)
LstBxCost.Items.RemoveAt(Selection)
Else
MsgBox("Unable to delete selected item", , "Error")
End If
End Sub
Any help is much appreciated
Thanks Selfa97