This example demonstrates how you can respond to a button click by performing some work on a worker thread and then update the user interface to indicate completion
void MyButton_OnClick(object sender, EventArgs args)
{
Task.Run(() => // Schedule work using the thread pool
{
...