注册 登录
编程论坛 VB.NET论坛

多线程 创建包含线程的类出错!

nich 发布于 2012-05-29 09:58, 524 次点击
程序实现功能:两个界面,第一个界面显示数据,第二界面进行曲线绘图。多线程可以让两个界面同时运行程序的吧!
刚接触多线程,书上介绍说第一步创建一个包含线程的类(如:myclass1),第二步:在主类中创建myClass1 类的对象
疑问:第一步怎么创建呢?书上的代码也没有说明,只有第二步的:dim p as new myclass1

我在程序中编写出错 如下图。请高手告之,感谢。在线等。。。
只有本站会员才能查看附件,请 登录
。。
1 回复
#2
mp654k2012-05-29 19:12
不需要创建类
imports system.threading
sub1()
do something here
thead.sleep(100)
end sub

sub2()
do something here
thead.sleep(100)
end sub

sub()
dim td1 as new thread(adress of sub1)
dim td2 as new thread(adress of sub2)
td1.start
td2.start
end sub

手写的,望能看懂.
1