
private void P1STRtextbox_TextChanged(object sender, EventArgs e)
{
if (Convert.ToInt32(P1STRtextbox.Text) > Convert.ToInt32(P1RemainingStatPointsLabel.Text))
{
MessageBox.Show("You have enter a number larger than your remaining stat points!");
}
else
{
P1RemainingStatPointsLabel.Text = (PlayerOne[P1ClassNumber].TotalStatPoints - Convert.ToInt32(P1STRtextbox.Text)).ToString();
}
}
private void P1DEXtextbox_TextChanged(object sender, EventArgs e)
{
if (Convert.ToInt32(P1DEXtextbox.Text) > Convert.ToInt32(P1RemainingStatPointsLabel.Text))
{
MessageBox.Show("You have enter a number larger than your remaining stat points!");
}
else
{
P1RemainingStatPointsLabel.Text = (PlayerOne[P1ClassNumber].TotalStatPoints - Convert.ToInt32(P1DEXtextbox.Text)).ToString();
}
}
So basicly the event is triggered when the text in the box is changed. When I input a number into the strength text box at first, it does the deductions properly, but when I go to the Dexterity box and try to edit the value, it does not do the deduction properly. As you can see in the picture(remaining stat points) that 3000-(250+750) != 2250; Can someone please give me some logical advice? Thank you for your time and effort in advance!