Advertisement
Guest User

Untitled

a guest
Feb 24th, 2020
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.29 KB | None | 0 0
  1. BackgroundWorker bwst = new BackgroundWorker();
  2. if (!bwst.IsBusy)
  3. {
  4.         bwst.WorkerReportsProgress = true;
  5.         bwst.DoWork += delegate
  6.         {
  7.                 MyMethod();
  8.                
  9.         };
  10.  
  11.         bwst.RunWorkerCompleted += delegate
  12.         {
  13.                
  14.                 // Do something when finished
  15.         };
  16.  
  17.         bwst.RunWorkerAsync();
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement