Code:
Private Sub btnaddcart_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnaddcart.Click
Dim part As PartDescription = New PartDescription()
part = CType(lbxItems.SelectedItem, PartDescription)
Dim SItem As String
Dim Updateqty As Boolean = False
SItem = part.PartNumber
MsgBox(SItem)
For Each i As string In lstPart.Items
If lstPart.SelectedItem.ToString = SItem Then
Dim tempqty As Integer = Integer.Parse(lstQuantity.SelectedItem.Items.text)
tempqty += 1
lstQuantity.SelectedItem.Items.text = tempqty.ToString
Updateqty = True
End If
Next
If Updateqty = False Then
lstPart.Items.Add(part.PartNumber)
lstDescripption.Items.Add(part.PartName)
lstUCost.Items.Add(part.UnitPrice)
lstQuantity.Items.Add("1")
lstUCost.Text = (part.UnitPrice * 1).ToString()
End If
End Sub
i have a bunch of listboxes one has the final item you select then press addtocart witch will take seprate parts of the string and add themm to the relevent listbox and have qty set to 1 what i want is if the same item is selected again is instead of making a dublicate is to increse the relevent qty in the qty listbox but i keep getting this error
Public member 'Items' on type 'String' not found
i know i could use a listview for this task instead but i wanted to do it with seprate listboxes any help would be appreciated thanks