Get your user to type correct values?
Or use the right textbox?
You are handling the textBox2 event, but you don;t reference textBox2 at all - I suspect you meant 2 rather than 3.
But even then, that is a poor way to treat users.
Before you use a value, check it, and report problems to your user: at the moment, if he leaves a field blank your program crashes. If he miskeys and gets a comma instead of a dot, it crashes. If he types his name, it crashes. That really is poor - it would annoy the heck out of you, wouldn't it?
Try this:
private void textBox2_TextChanged(object sender, EventArgs e)
{
float t;
float g;
if (!float.TryParse(textBox3.Text, out t))
{
MessageBox.Show("Please type a number in textbox 3!");
return;
}
if (!float.TryParse(textBox10.Text, out g))
{
MessageBox.Show("Please type a number in textbox 10!");
return;
}
float j = g * (t / 100) + g;
string result = j.ToString();
if (textBox2.Text != result)
{
textBox2.Text = result;
}
}
Notice the bit at the bottom: if you just set the value of TextBox2.Text each time, it will immediately cause a new event to occur!
And do yourself a favour: stop using VS default names for controls! Calling your controls a name that describes what the user uses them for makes your code much more reliable and readable!
textBox2 => tbTaxDue
textBox10 => tbTaxRate
and so forth.