|
-
Oct 29th, 2008, 04:17 PM
#1
Thread Starter
Lively Member
[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.
Last edited by ahostbr; Oct 29th, 2008 at 04:51 PM.
-
Oct 29th, 2008, 06:24 PM
#2
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.
-
Oct 29th, 2008, 06:48 PM
#3
Thread Starter
Lively Member
Re: Interacting W/ WebBrowser in a BackgroundWorker
ok thx jm, so second question, how would i create the web browser in a new thread?
-
Oct 29th, 2008, 06:59 PM
#4
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|