Results 1 to 1 of 1

Thread: WebBrowser in extra Thread dont Downloadcomplete Event

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2015
    Posts
    3

    Unhappy WebBrowser in extra Thread dont Downloadcomplete Event

    Hello,

    I have the following problem:

    The downloadcomplete event is not loaded in the sub.

    Unless I insert a Messagebox.Show as a test. Then the downloadcomplete event is triggered. I do not understand the problem.

    Button calls thread with:

    Code:
    Dim ThreadX As New Thread(AddressOf MTX)
    ThreadX.SetApartmentState(ApartmentState.STA)
    ThreadX.Start()
    The web browser element is created in a new thread: (Works with Messagebox "MessageBox.Show("OK1")". Without dont work)

    Code:
        Sub MTX()
            Dim WB1 As New WebBrowser
            WB1.ScriptErrorsSuppressed = True
            WB1.Navigate(New Uri("https://google.at"))
    
    Reload:
            MessageBox.Show("OK1")
            If WB1.ReadyState = WebBrowserReadyState.Complete Then
                MessageBox.Show("LOADED")
            Else
                Thread.Sleep(500)
                GoTo Reload
            End If
    
        End Sub
    I have also tried it with a Do While Loop, without success

    Any ideas? i Search since 2 days over 10 hours
    Last edited by hasexxl1988; Dec 25th, 2023 at 02:11 PM.

Tags for this 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
  •  



Click Here to Expand Forum to Full Width