跨线程操作无效:从...访问控件"Panel1". [英] Cross-thread operation not valid: Control 'Panel1' accessed from....

查看:67
本文介绍了跨线程操作无效:从...访问控件"Panel1".的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



这是我收到的错误消息:

跨线程操作无效:从创建该线程的线程以外的线程访问控件"Panel1"."


现在我知道有一些与此主题类似的主题,但是它们并没有真正帮助,而且大多数主题令人困惑.

我收到此错误的原因是因为我正在打开一个新表单,然后调用这三件事:

Hi,

This is the error message I am getting:

"Cross-thread operation not valid: Control ''Panel1'' accessed from a thread other than the thread it was created on."


Now I know there have been some topics similar to this but they didn''t really help and most were confusing.

The reason I am getting this error is because I am opening up a new form and then calling these three things:

Panel1.Show()
Label1.Show()
Label2.Show()



唯一的原因是我不明白为什么会收到此错误消息,因为如果在关闭Form1之后打开Form2,它不会正常发生,那么只有在关闭Form4之后打开Form2时,它才会发生.

任何帮助将不胜感激:)
谢谢



The only reason is I don''t understand why I get this error message because it doesn''t occur normally if I open Form2 after closing Form1, it only occurs when I open Form2 after closing Form4.

Any help would be most appreciated :)
Thanks

推荐答案

阅读:如何解决交叉线程操作无效" [^ ]


这篇关于跨线程操作无效:从...访问控件"Panel1".的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆