Skip to content

Instantly share code, notes, and snippets.

@Fhernd
Created June 22, 2013 21:20
Show Gist options
  • Save Fhernd/5842662 to your computer and use it in GitHub Desktop.
Save Fhernd/5842662 to your computer and use it in GitHub Desktop.
private async void btnCalcular_Click(object sender, EventArgs e)
{
this.btnCalcular.Enabled = false;
var tarea = Task<int>.Factory.StartNew(() => FuncionSumaLenta(Int32.Parse(txtNumeroA.Text),Int32.Parse(txtNumeroB.Text)));
await tarea;
this.lblResulado.Text = "Resultado: " + tarea.Result.ToString();
this.btnCalcular.Enabled = true;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment