不能在另一个线程上使用GeckoFX

时间:2016-05-03 18:42:08

标签: vb.net multithreading geckofx

我正在尝试从另一个backgroundWorker更改一些geckofx prefrence。

开始调试后我得到了这个:

  

{“GeckoFx只能从它所在的同一个线程中调用   初始化(通常是UI线程)。“}


Public Sub BackgroundWorker1_DoWork(ByVal sender As System.Object, ByVal e As System.ComponentModel.DoWorkEventArgs) Handles BackgroundWorker1.DoWork
    Do

        Thread.Sleep(10000)
        GeckoPreferences.User("general.useragent.override") = operalinux

        ualabel.Text = "operalx"

        Thread.Sleep(10000)
        GeckoPreferences.User("general.useragent.override") = operawin
        ualabel.Text = "operawin"


        Thread.Sleep(10000)
        GeckoPreferences.User("general.useragent.override") = CHROMELINUXUA
        ualabel.Text = "chromelux"
        Thread.Sleep(10000)
        GeckoPreferences.User("general.useragent.override") = CHROMEWINDOWSUA
        ualabel.Text = "chromewin"


        Thread.Sleep(10000)
        GeckoPreferences.User("general.useragent.override") = FIREFOXLINUXUA
        ualabel.Text = "FFLUX"

        Thread.Sleep(10000)
        GeckoPreferences.User("general.useragent.override") = FIREFOXWINDOWSUA
        ualabel.Text = "FFWIN"
        Thread.Sleep(10000)

    Loop
End Sub

0 个答案:

没有答案