由于在其他地方使用,访问“控制”被拒绝 [英] accessing a 'control' is denied due to use elsewhere
问题描述
Public Sub thread_A()
0:Thread.Sleep(500)
PictureBox1.Visible = False
Thread。睡眠(250)
PictureBox1.Visible = True
Thread.Sleep(225)
PictureBox1.Visible = False
Thread.Sleep(100)
PictureBox1.Visible =真
GoTo 0
结束子
此程序引发异常行我偶尔在标题中写的。我在vb设置中检查了交叉线程。这就是为什么会发生这种情况的原因?我不太了解这个话题,试着离散。谢谢。
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
这个程序抛出一个异常,就像我在标题时不时。我在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.
这篇关于由于在其他地方使用,访问“控制”被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!