Here is what it DOES. It runs through the first For Each loop and populates the appropriate field. It ignores the second loop because there are no weapon Class instances in that list. Then it goes wrong. It IGNORES the remaining lines (including the third MessageBox.Show) and somehow assigns a value of 0 to the private variable, _handsRemaining.
Why is this happening? What can be done to fix it?
Private _handsRemaining As Integer Private Sub Inventory_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Dim hand As Integer = 2 MessageBox.Show(hand & " 0") For Each thing As Object In _invList lboInventory.Items.Add(thing.name) Next MessageBox.Show(hand & " 1") For Each swish As Weapon In _wieldList hand = hand - swish.hands lboWield.Items.Add(swish.name) Next handsRemaining = hand MessageBox.Show(hand & " 2") End Sub