[RESOLVED] Interacting W/ WebBrowser in a BackgroundWorker
Hey guys, anyone have any ideas on how i would go about filling text boxes and submitting forms in a new thread/BackgroundWorker?
because everytime i try i keep getting cross thread errors...
Would i have to create the web browser in the do work event? or is there a better way to go about this?
because my users see the page as its getting manipulated, and i do not want them not to be able to see whats going on, which i think would be the case if i created a new browser in the thread...
any suggestions would be much appreciated.
Re: Interacting W/ WebBrowser in a BackgroundWorker
You can't access most members of a control in a thread other than the one that created it, plain and simple. If you want the user to see the WebBrowser then it must be created in the UI thread. You can do some processing in a worker thread but anything that actually manipulates the UI must be done in the UI thread. There's no avoiding it.
Re: Interacting W/ WebBrowser in a BackgroundWorker
ok thx jm, so second question, how would i create the web browser in a new thread?
Re: Interacting W/ WebBrowser in a BackgroundWorker
If you want a control created on a particular thread then you simply create it in a method that is executed on that thread. Like I said though, you can't then display it to the user on a form that was created on the main thread.