1
I need to calculate a value entered in Textbox
and this value I enter is multiplied by 9,81
. So all the numbers I insert in this Textbox will be multiplied by 9,81
and you will have to show me the result on the Textbox
.
Example: I type in the Textbox
: 6000
and that 6000
will be multiplied by 9.81
. And the same textbox will have to show me 58.860
.
Observing: the values I enter will be random, only the 9.81
shall be fixed in the calculation.
private void txtCalcular_TextChanged(object sender, EventArgs e)
{
Calcular = double.Parse((txtCalcular.Text).ToString());
ResultadoCalcular = double.Parse(
(txtCalcular.Text = (Calcular * 9.81).ToString())
);
}
I tried to do it this way too, but without success:
Calcular = double.Parse((txtCalcular.Text = (Calcular * 9.81).ToString()));
Thank you so much for the quick return! I just entered the code, there was no error, but at the moment of compilation when I start typing it appears the number I am typing and the infinity symbol (6000 ) and when I press "enter" nothing happens. What could be?
– Hermione
There is another problem, need more information, on another question, clearly showing everything important to see, with the posted has no way of knowing.
– Maniero
I understand, the strange thing is that there is no error, neither before nor at the time of the compilation. I will open another question then, showing what happens. Thanks!
– Hermione