Private Sub Command1_Click()
If Command1.Caption = "Start" Then
Timer1.Enabled = True
Command1.Caption = "Stop"
Else
Timer1.Enabled = False
Command1.Caption = "Start"
End If
End Sub
Private Sub Timer1_Timer()
Randomize
a = Int(Rnd * 4 + 1)
Text1(a).Text = "姓名1"
Do
b = Int(Rnd * 4 + 1)
Loop While a = b
Text1(b).Text = "姓名2"
Do
c = Int(Rnd * 4 + 1)
Loop While a = c Or b = c
Text1(c).Text = "姓名3"
Do
d = Int(Rnd * 4 + 1)
Loop While a = d Or b = d Or c = d
Text1(d).Text = "姓名4"
End Sub