错误:“跨线程操作无效”问题在这里 [英] Error: "Cross-thread operation not valid" Problem here

查看:62
本文介绍了错误:“跨线程操作无效”问题在这里的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿大家......

我有一个代码,它给了我这个错误。


错误:跨线程操作无效:控制''textBox1''从其创建的线程以外的线程访问。


我实际上是动态填充用户控件。当我尝试用值填充它时会出现问题。并且代码在30秒或更长时间后再次运行以获取更新值等等。


代码如下:

这实际上是用户控件应该根据查询动态瞳孔化并提供值...此用户控件称为视图

展开 | 选择 | Wrap | 行号

解决方案

您是否设置了断点以查看您收到错误消息的位置?如果没有,请这样做并告诉我们哪一行给你错误。


史蒂文


是的,我确实设置了断点。 ..它在下面一行给了我一个错误。 :

展开 | 选择 | Wrap | 行号


我不知道怎么做但当我调用函数时它还有12个值..


问候,
Syed Ahmed Hussain


hey everyone...
I have a code which gives me this error.

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

I am actually populating a user control dynamically. And the problem arises when i try to populate it with values. and the code runs again after 30 or more seconds to get updated values and so on..

The code is given below
This is actually the user control which should be pupulated dynamically and provide values according to the query...This user control is known as view

Expand|Select|Wrap|Line Numbers

解决方案

Did you set breakpoints to see at what point you get the error message? If not, please do so and tell us which line gives you the error.

Steven


Yes I did set up the break points .... It gave me an error on the following line. :

Expand|Select|Wrap|Line Numbers


I dont know how but when I called the function it got 12 values in it as well..

regards,
Syed Ahmed Hussain


这篇关于错误:“跨线程操作无效”问题在这里的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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