且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

由于在其他地方使用,访问“控制”被拒绝

更新时间:2022-10-17 22:57:30


 Public Sub thread_A()

0:Thread.Sleep(500)
PictureBox1.Visible = False
Thread.Sleep(250)
PictureBox1.Visible = True
Thread.Sleep(225)
PictureBox1.Visible = False
Thread.Sleep(100)
PictureBox1.Visible = True

GoTo 0

End Sub




这个程序抛出一个异常,就像我在标题时不时。我在vb设置中检查了交叉线程。这就是为什么会发生这种情况的原因?我不太了解这个话题,试着离散。感谢。


Public Sub thread_A()

0:      Thread.Sleep(500)
        PictureBox1.Visible = False
        Thread.Sleep(250)
        PictureBox1.Visible = True
        Thread.Sleep(225)
        PictureBox1.Visible = False
        Thread.Sleep(100)
        PictureBox1.Visible = True

        GoTo 0

    End Sub


hi, this program throws a exception along the lines of what i wrote in the title now and then. I have check for cross threading off in vb settings. is this the reason why this is happening? I do not know too much about this topic and try to be discrete. thanks.


llama

Public Sub thread_A()

0:      Thread.Sleep(500)
        PictureBox1.Visible = False
        Thread.Sleep(250)
        PictureBox1.Visible = True
        Thread.Sleep(225)
        PictureBox1.Visible = False
        Thread.Sleep(100)
        PictureBox1.Visible = True

        GoTo 0

    End Sub


hi, this program throws a exception along the lines of what i wrote in the title now and then. I have check for cross threading off in vb settings. is this the reason why this is happening? I do not know too much about this topic and try to be discrete. thanks.