I declared the same int variables as you declared.
int ms, p, i, tot;
There is no need to write int 32 for declaring variable, if you write int then also it works.
private void textBox1_TextChanged(object sender, EventArgs e)
{
if (textBox1.Text != "")
{
ms = Convert.ToInt32(textBox1.Text);
tot = ms + p + i;
textBox4.Text = tot.ToString();
}
else
{
ms = 0;
tot = ms + p + i;
textBox4.Text = tot.ToString();
}
}
private void textBox2_TextChanged(object sender, EventArgs e)
{
if (textBox2.Text != "")
{
p = Convert.ToInt32(textBox2.Text);
tot = ms + p + i;
textBox4.Text = tot.ToString();
}
else
{
p = 0;
tot = ms + p + i;
textBox4.Text = tot.ToString();
}
}
private void textBox3_TextChanged(object sender, EventArgs e)
{
if (textBox3.Text != "")
{
i = Convert.ToInt32(textBox3.Text);
tot = ms + p + i;
textBox4.Text = tot.ToString();
}
else
{
i = 0;
tot = ms + p + i;
textBox4.Text = tot.ToString();
}
}