Advertisement
Guest User

Untitled

a guest
Aug 4th, 2015
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. private void button1_Click(object sender, EventArgs e)
  2. {
  3. int t1, t3, t4;
  4. double t2, t5, t6, t7, t8 = 1000.0, t9 = 1000.0, t10 = 100.0, t11 = 500.0;
  5. t1 = Convert.ToInt32(textBox1.Text);
  6. t2 = Convert.ToDouble(textBox2.Text);
  7. t3 = Convert.ToInt32(textBox3.Text);
  8. t4 = Convert.ToInt32(textBox4.Text);
  9. t5 = (t1 / t9);
  10. t6 = (t2 / t8);
  11. t7 = (t5 + t6);
  12.  
  13. textBox5.Text = string.Format("{0};{1};{2};{3}Vol={4}_OpI={5}", t7, "clrRed", 1, 0, t3, t4); // вывод результата в пятый textbox
  14. }
  15.  
  16. int t1;
  17. if (!Int32.TryParse(textBox1.Text, out t1))
  18. {
  19. throw new InvalidOperationException("Введите число");
  20. }
  21.  
  22. // дальше можно работать с t1
  23. // аналогично для других переменных
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement