I have a bunch of code in a button that calculates many things when clicked and places them in labels.. But for some reason I have to click the button once and it will display some of the data then I have to click it again to display the rest.
I think this is because i using a label that is calculated when the button is clicked as a reference in another equation (which is the one missing that makes me have to click the button again)
here is a part of the code that is in the button:
Calculates Combat Level
If (Ranged * 1.5) < (Attack + Strength) Then
Label16.Text = (Attack + Defense + Strength + Hits) / 4 + (Magic + Prayer) / 8
End If
Calculates Combat Level
If (Ranged * 1.5) > (Attack + Strength) Then
Label16.Text = (Defense + Hits) / 4 + (Magic + Prayer) / 8 + Ranged * 0.375
End If
Calculates how many lvls needed to advance
Label14.Text = Fix(Label16.Text)
Label21.Text = (CombatE - CombatR) / 0.25 Primary lvls
Label22.Text = (CombatE - CombatR) / 0.125 Secondardy lvls
-------------------------
The Part with Label21.Text = (CombatE - CombatR)/.25 and the one right underneath are the two formulas that wont calculate until i click the button a second time.
I think this is because i using a label that is calculated when the button is clicked as a reference in another equation (which is the one missing that makes me have to click the button again)
here is a part of the code that is in the button:
Calculates Combat Level
If (Ranged * 1.5) < (Attack + Strength) Then
Label16.Text = (Attack + Defense + Strength + Hits) / 4 + (Magic + Prayer) / 8
End If
Calculates Combat Level
If (Ranged * 1.5) > (Attack + Strength) Then
Label16.Text = (Defense + Hits) / 4 + (Magic + Prayer) / 8 + Ranged * 0.375
End If
Calculates how many lvls needed to advance
Label14.Text = Fix(Label16.Text)
Label21.Text = (CombatE - CombatR) / 0.25 Primary lvls
Label22.Text = (CombatE - CombatR) / 0.125 Secondardy lvls
-------------------------
The Part with Label21.Text = (CombatE - CombatR)/.25 and the one right underneath are the two formulas that wont calculate until i click the button a second time.