+ 3
textBox6.Text did not show the correct answer
private void button1_Click(object sender, EventArgs e) { if (!string.IsNullOrEmpty(textBox1.Text) && !string.IsNullOrEmpty(textBox2.Text) && !string.IsNullOrEmpty(textBox3.Text) && !string.IsNullOrEmpty(textBox4.Text) && !string.IsNullOrEmpty(textBox5.Text)) textBox6.Text = (Convert.ToDouble(textBox1.Text) * Convert.ToDouble(textBox2.Text) * ((Convert.ToDouble(textBox3.Text) + Convert.To Double(textBox4.Text))/12) * Convert.ToDouble(textBox5.Text)).ToString(); }
8 odpowiedzi
+ 4
thanks for your answer Mr.Volker Milbrandt and Mr.sneeze
closing } is contain
textBox6.Text do not show the correct answer
+ 2
Thank all
finally i could
thanks
+ 2
textBox6.Text did not show the correct answer
private void button1_Click(object sender, EventArgs e)
{
if (!string.IsNullOrEmpty(textBox1.Text) && !string.IsNullOrEmpty(textBox2.Text) && !string.IsNullOrEmpty(textBox3.Text) && !string.IsNullOrEmpty(textBox4.Text) && !string.IsNullOrEmpty(textBox5.Text))
textBox6.Text = (Convert.ToDouble(textBox1.Text) * Convert.ToDouble(textBox2.Text) * (Convert.ToDouble(textBox3.Text) + Convert.To Double(textBox4.Text)/12) * Convert.ToDouble(textBox5.Text)).ToString();
} //actually I convert squarefeet from feet and inches
+ 1
how do you guarantee that all text boxes contain a valid double to convert and no other text?
closing } is missing.
are all text boxes accessible?
+ 1
use variables
make smaller steps
use {} the are not mandatory but increase the readablity of your code.
what do you want to do ?
+ 1
can you give example data ?
is the mathematical precedence correct ?
+ 1
I dint try but go on positive way to enter all data in correct format.
((convert.todouble(textbox1.text)* convert.todouble(textbox2.text)) *
((convert.todouble(textbox3.text)*
convert.todouble (textbpx4.text)) / 12)*
convert.todouble(textbox5.text)).tostring()
kindly note don't go on syntax error.
thanks ..
+ 1
@Theikdi Maung: and what was now the solution?