hi, can u check where have i gone wrong on this code?

i have 2 listviews with similar columns, whenever i click the item on listview_1, it will transfer to my listview_2. the code below adds the column_named 'UNITS' to my label box

For Each TempNode In ListView1.Items
If Double.TryParse(TempNode.SubItems.Item(2).Text, TempDbl) Then
TotalUnit += TempDbl
Label15.Text = TotalUnit
End If
Next

but how can i deduct whats on my label box whenever i remove the item in my listview_2?


please help. sorry if i didnt explain it clearly..

Why not subtract the Value of your ListView2.SubItem just before you remove your ListView2.Item?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.