C#: Passing data to BackgroundWorker DoWork Event

Normally, you call the RunWorkerAsync() without an argument to start the background worker. Sometimes you might want to pass some data into the DoWork() function. All you have to do is simply do: RunWorkerAsync(some data) For example, the following code pass an array of string: string[] list = {"one", "two", "three"}; MyBackgroundWorker1.RunWorkerAsync(List); Then you have […]