0

I'm confused about how to put method called by event (like when i press a button and Button_Click(object sender, EventArgs e) is called) on a different thread to run in parallel with main thread.

Any help would be appreciated.

DevGambit
  • 53
  • 1
  • 9
  • You're looking for `await Task.Run()` – SLaks Nov 16 '15 at 18:12
  • @SLaks can you give an example? – DevGambit Nov 16 '15 at 18:18
  • Do you really want another thread or do you want non-blocking parallelism? – H H Nov 16 '15 at 18:29
  • There are probably at least a dozen different ways to execute code in a new thread. Please start with the marked duplicate. See also [How can I fire an event without waiting for the event listeners to run?](https://stackoverflow.com/q/890896) and [How to make a method run in the “background” (threading?)](https://stackoverflow.com/q/6719132/3538012), and of course https://stackoverflow.com/search?q=%5bc%23%5d%20run%20method%20in%20thread. – Peter Duniho Nov 16 '15 at 18:54
  • If you run into a _specific_ problem, please feel free to post a new question. Be sure to include [a good, _minimal_, _complete_ code example](http://stackoverflow.com/help/mcve) that reliably reproduces that problem. Be precise and specific about what that code does and how that's different from what you want. – Peter Duniho Nov 16 '15 at 18:55

0 Answers0