Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void startCalculcationButton_Click(object sender, EventArgs e) {
- int number;
- if (int.TryParse(this.numberTextBox.Text, out number)) {
- this.calculationResultLabel.Text = "(computing)";
- Task.Factory.StartNew(() => {
- int result = LongCalculation(number);
- this.calculationResultLabel.BeginInvoke(new ThreadStart(() => {
- this.calculationResultLabel.Text = result.ToString();
- }));
- });
- }
- }
Add Comment
Please, Sign In to add comment