Esempio n. 1
0
 //Дециметр
 private void textBox3_TextChanged(object sender, EventArgs e)
 {
     if (!activeTextBox)
     {
         if (textBox3.Text != "")
         {
             try
             {
                 activeTextBox = true;
                 double lenght = Convert.ToDouble(textBox3.Text);
                 Dm     dm     = new Dm();
                 textBox1.Text  = Convert.ToString(dm.getMetr(lenght));
                 textBox2.Text  = Convert.ToString(dm.getSm(lenght));
                 textBox4.Text  = Convert.ToString(dm.getMm(lenght));
                 textBox5.Text  = Convert.ToString(dm.getVershok(lenght));
                 textBox6.Text  = Convert.ToString(dm.getPyad(lenght));
                 textBox7.Text  = Convert.ToString(dm.getArshin(lenght));
                 textBox8.Text  = Convert.ToString(dm.getSagen(lenght));
                 textBox9.Text  = Convert.ToString(dm.getFoot(lenght));
                 textBox10.Text = Convert.ToString(dm.getInch(lenght));
                 textBox11.Text = Convert.ToString(dm.getCable(lenght));
                 textBox12.Text = Convert.ToString(dm.getYard(lenght));
             }
             catch (Exception)
             {
                 MessageBox.Show("Ошибка в вводимого значения");
                 textBox3.Clear();
             }
             activeTextBox = false;
         }
     }
 }