title: C# -> How to read and print values form Textbox in realtime
body: <p>how do I get the values from the TextBox and to immediately display the calculated results in the other TextBoxes?</p>
  <p><a href="https://i.stack.imgur.com/S9ykJ.png" rel="nofollow noreferrer">enter image description here</a></p>
  <p>I want to load values and according to formulas to change in other TextBoxes.</p>
  <p>This code does not work like that, or the only thing that is calculated is the average ap, but the result will be displayed only after typing any character into the textbox. All other textboxes are non-rewritable 0 or NaN.</p>
  <pre><code>using System;
  using System.Drawing;
  using System.Windows.Forms;
  
  namespace sustruzenie_frezovanie
  {
      /// &lt;summary&gt;
      /// Description of sustruzenie.
      /// &lt;/summary&gt;
      public partial class sustruzenie : Form
      {   
          double d = 0;
          double dm = 0;
          double vc = 0;
          double f = 0;
          double n = 0;
          double ap = 0;
          double vf = 0;
          public const double PI = 3.1415926535897931;
          public sustruzenie()
          {
              InitializeComponent();
          }
          void Label1Click(object sender, EventArgs e)
          {
              
          }
          void TextBox1TextChanged(object sender, EventArgs e)
          {
              double.TryParse(textBox1.Text, out d);
              d = double.Parse(textBox1.Text);
          }
          void TextBox2TextChanged(object sender, EventArgs e)
          {
              double.TryParse(textBox2.Text, out dm);
              dm = double.Parse(textBox2.Text);
          }
          void TextBox3TextChanged(object sender, EventArgs e)
          {
              double.TryParse(textBox3.Text, out vc);
              vc = double.Parse(textBox3.Text);
              if(d &gt;=0 &amp;&amp; n &gt;= 0)
              {
                  VypocetVc();
              }
          }
          void TextBox4TextChanged(object sender, EventArgs e)
          {
              double.TryParse(textBox4.Text, out vf);
              vf = double.Parse(textBox4.Text);
              if(f &gt;=0 &amp;&amp; n &gt;= 0)
              {
                  VypocetVf();
              }
          }
          void TextBox5TextChanged(object sender, EventArgs e)
          {
              double.TryParse(textBox5.Text, out n);
              n = double.Parse(textBox5.Text);
              if(vc &gt;=0 &amp;&amp; d &gt;= 0)
              {
                  VypocetN();
              }
          }
          void TextBox6TextChanged(object sender, EventArgs e)
          {
              double.TryParse(textBox6.Text, out f);
              f = double.Parse(textBox6.Text);
              if(vf &gt;=0 &amp;&amp; n &gt;= 0)
              {
                  VypocetF();
              }
          }
          void TextBox7TextChanged(object sender, EventArgs e)
          {
              double.TryParse(textBox7.Text, out ap);
              ap = double.Parse(textBox7.Text);
              if(d &gt;=0 &amp;&amp; dm &gt;= 0)
              {
                  VypocetAp();
              }
          }
          void SustruzenieTextChanged(object sender, EventArgs e)
          {
      
          }
          private void VypocetVc()
          {
              textBox3.Text = ((PI * d * n)/100).ToString();
          }
          private void VypocetVf()
          {
              textBox4.Text = (f * n).ToString();
          }
          private void VypocetN()
          {
              textBox5.Text = ((vc * 1000)/(PI * d)).ToString();
          }
          private void VypocetF()
          {
              textBox6.Text = (vf/n).ToString();
          }
          private void VypocetAp()
          {
              textBox7.Text = ((d - dm)/2).ToString();
          }
      }
  }
  </code></pre>