Hi guys!
I am having an issue sharing a variable between 2 forms. The first form populates this variable, which is an array, using a backgroundworker.
This background worker is responsible for populating the array, after it finishes the first form loads a second form that is required to use the information in the array.
Now, unfortunately, this is not possible because the copy of the array that form2 gets is null. I have tried several things to fix it, one of them is to put populating the array in the bakcgroundWorkerReportsProgress event handler of form 1, also tried to pass the array to the constructor of the second form, but still it gets a null array and none of the values are there.
I just need a way to share this variable, which is globally declared, between 2 forms given that it is created in a backgroundWorkerThread.
Any tips?
Thanks
I am having an issue sharing a variable between 2 forms. The first form populates this variable, which is an array, using a backgroundworker.
This background worker is responsible for populating the array, after it finishes the first form loads a second form that is required to use the information in the array.
Now, unfortunately, this is not possible because the copy of the array that form2 gets is null. I have tried several things to fix it, one of them is to put populating the array in the bakcgroundWorkerReportsProgress event handler of form 1, also tried to pass the array to the constructor of the second form, but still it gets a null array and none of the values are there.
I just need a way to share this variable, which is globally declared, between 2 forms given that it is created in a backgroundWorkerThread.
Any tips?
Thanks