- 分享
- 0
- 人气
- 0
- 主题
- 62
- 帖子
- 6367
- UID
- 51295
- 积分
- 3715
- 阅读权限
- 21
- 注册时间
- 2006-11-21
- 最后登录
- 2022-1-19
- 在线时间
- 3699 小时
 
|
Imports System.Threading
...
' This value is incremented by all threads.
Public Value As Integer = 0
Private Sub btnStartThread_Click(ByVal sender As _
System.Object, ByVal e As System.EventArgs) Handles _
btnStartThread.Click
' Make a new counter object.
Static thread_num As Integer = 0
Dim new_counter As New Counter(Me, thread_num)
thread_num += 1
' Make a thread to run the object's Run method.
Dim counter_thread As New Thread(AddressOf _
new_counter.Run)
' Make this a background thread so it automatically
' aborts when the main program stops.
counter_thread.IsBackground = True
' Start the thread.
counter_thread.Start()
End Sub
http://www.vb-helper.com/howto_net_run_threads.html |
|