Hey everyone,
I'm having a problem with an updown thingy. When you click the up and down arrows it adds or subtracts from your total money to spend, but if you manually imput a number into the box it doesn't change the money. :-/
Here's part of my code where "rs" is the total you have to spend:
VB Code:
Private Sub resourcesValue() If purchase Then spent = scal + sinf + sgen + sart + skni + sport lblResources.Text = "Available Resources: " & rs - spent If (rs - spent < 0) Then lblResources.ForeColor = Color.Red btnPurchase.Enabled = False Else lblResources.ForeColor = Color.Black btnPurchase.Enabled = True End If End If End Sub Private Sub udCalvary_ValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles udCalvary.ValueChanged scal = udCalvary.Value * 8 resourcesValue() End Sub Private Sub udKnight_ValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles udKnight.ValueChanged skni = udKnight.Value * 11 resourcesValue() End Sub Private Sub udInfantry_ValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles udInfantry.ValueChanged sinf = udInfantry.Value * 5 resourcesValue() End Sub
Is there any way I can make it read this value change too? Thanks,
Mike




Reply With Quote