English_man69
New member
- Joined
- Sep 21, 2005
- Messages
- 3
- Programming Experience
- 1-3
Referencing main form from within ThreadPool
Hi All,
I am still kinda new to VB.Net, so go easy...
I have established a thread pool that is started from a click event handler. I can get everything in the thread pool to work except when I try to add a picture box to the main form.
The program accesses a web page, does a search, parses the returned web page into an array of id numbers and image links. I have the web page processing done within a thread pool, because otherwise the program appears to freeze while the page is being accessed.
My problem is in trying to create picture boxes within a panel established on the main form from within the thread pool. I get the following error message "reference to a non-shared member requires an object reference".
The Panel already exists and the picture boxes have to be created from within a loop within the Thread Pool. (Though I have tried creating the Panel while in the Thread also to no success)
How can I reference the main form's Panel to add the picture box to it, from within the thread pool?
Thanks a lot!
Hi All,
I am still kinda new to VB.Net, so go easy...
I have established a thread pool that is started from a click event handler. I can get everything in the thread pool to work except when I try to add a picture box to the main form.
The program accesses a web page, does a search, parses the returned web page into an array of id numbers and image links. I have the web page processing done within a thread pool, because otherwise the program appears to freeze while the page is being accessed.
My problem is in trying to create picture boxes within a panel established on the main form from within the thread pool. I get the following error message "reference to a non-shared member requires an object reference".
The Panel already exists and the picture boxes have to be created from within a loop within the Thread Pool. (Though I have tried creating the Panel while in the Thread also to no success)
How can I reference the main form's Panel to add the picture box to it, from within the thread pool?
Thanks a lot!