vb.net有多线程和调用的问题 [英] vb.net issues with multithreading and invoke

查看:105
本文介绍了vb.net有多线程和调用的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

到目前为止,在使用多个线程时,我使用委托和调用来编辑ui元素。问题是改变不同的ui元素,我必须每次都定义一个新的子,因为thread.start()方法只接受一个参数,所以我不能把所有东西都塞进一个子。有没有办法在thread.start()方法中使用多个参数?

So far while working with multiple threads, i edit ui elements using delegates & invoke. The problem is for changing different ui elements, i have to define a new sub every time since the "thread.start()" method only takes one parameter so i cannot stuff everything in one sub. Is there a way of using multiple parameters with the "thread.start()" method?

推荐答案

传递给thread.start()的参数是一个对象。您可以创建设计对象,并将所有要传递给该对象内的thread.start()的值。
The parameter passed to thread.start() is an object. You can create an object of your design and have all the values you wish to pass to thread.start() inside that object.


这篇关于vb.net有多线程和调用的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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