帮我看看这段子程序可以通过Delegate来建立新的线程,并传递button吗?
Public Sub Compare(ByRef btn As Button)
If Convert.ToByte(btn.Text) = ClickTimes Then
If RadioButton1.Checked Then
btn.BackColor = Color.Green
Else
btn.BackColor = Color.Green
Sleep(19990)
mytimer += 20
btn.BackColor = Color.White
End If
If CheckBox1.Checked Then
ClickTimes -= 1
If ClickTimes <= 0 Then
playing = False
End If
Else
ClickTimes += 1
If ClickTimes >= 26 Then
playing = False
End If
End If
Else
Dim tempColor As Color = btn.BackColor
btn.BackColor = Color.Red
Sleep(19990)
mytimer += 20
btn.BackColor = tempColor
End If
End Sub
Public Sub Compare(ByRef btn As Button)
If Convert.ToByte(btn.Text) = ClickTimes Then
If RadioButton1.Checked Then
btn.BackColor = Color.Green
Else
btn.BackColor = Color.Green
Sleep(19990)
mytimer += 20
btn.BackColor = Color.White
End If
If CheckBox1.Checked Then
ClickTimes -= 1
If ClickTimes <= 0 Then
playing = False
End If
Else
ClickTimes += 1
If ClickTimes >= 26 Then
playing = False
End If
End If
Else
Dim tempColor As Color = btn.BackColor
btn.BackColor = Color.Red
Sleep(19990)
mytimer += 20
btn.BackColor = tempColor
End If
End Sub