Guest User

Untitled

a guest
Mar 21st, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. private void startCalculcationButton_Click(object sender, EventArgs e) {
  2. int number;
  3. if (int.TryParse(this.numberTextBox.Text, out number)) {
  4. this.calculationResultLabel.Text = "(computing)";
  5. Task.Factory.StartNew(() => {
  6. int result = LongCalculation(number);
  7. this.calculationResultLabel.BeginInvoke(new ThreadStart(() => {
  8. this.calculationResultLabel.Text = result.ToString();
  9. }));
  10. });
  11. }
  12. }
Add Comment
Please, Sign In to add comment