|
-
Jun 8th, 2008, 09:07 AM
#1
Thread Starter
Lively Member
[2008] Cross Thread issuses with WebBrowser control
I am loading a web page into a WebBrowser control so that I can access it's HTML later in the code using WebBrowser1.DocumentText. My problem is that I can access the HTML from outside the BackgroundWorker1 thread but I can not access the HTML from within the thread. Instead I get the following error: "Specified cast is not valid" refering to the WebBrowser1.DocumentText line of code. I have checked that it is not a document loaded issue the document has loaded.
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
WebBrowser1.Navigate("http://www.google.com/")
BackgroundWorker1.RunWorkerAsync()
End Sub
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
|