If Timer1.Enabled = True Then
Timer1.Enabled = False
MsgBox List1.Text &" " &List2.TextElse
List1.ListIndex = Int(Rnd() * 24)
List2.ListIndex = List1.ListIndex
Timer1.Interval = 100
Timer1.Enabled = True
End If
End SubPrivate Sub Form_Load()
'轮启历加腊搜测试数旁羡据
For i = 1 To 24
List1.AddItem Chr(i + 64)
List2.AddItem iNext
End SubPrivate Sub Timer1_Timer()
If List1.ListIndex = List1.ListCount - 1 Then
List1.ListIndex = 0
Else
List1.ListIndex = List1.ListIndex + 1
End If
List2.ListIndex = List1.ListIndex
End Sub
程序在下面,除去13号后总共点名39次,每次都不重复. 点完39次后可以复位又可以点名悉槐了。
Dim times, j As Integer
Dim num(1 To 40) As Integer
Private Sub Command1_Click()
start: Randomize
a = Int(Rnd * 40 + 1)
For i = 1 To 40
If a = num(i) Or a = 13 Then
GoTo start
End If
Next
Text1.Text = a
j = j + 1
num(j) = a
If j = 39 Then
MsgBox "所有人员均已点过!"
Command1.Enabled = False
Command2.Enabled = True
End 乎岩If
End Sub
Private Sub Command2_Click()
j = 0
For i = 1 To 40
num(i) = 0
Next
Command2.Enabled = False
Command1.Enabled = 岁陆御True
Text1.Text = ""
End Sub
界面:
建一个COmmand1。模式如下。
===========瞎蔽==
Option Base 1
Dim a, i As Integer
Private Sub Command1_Click()
i = Int(Rnd * 8 + 1)
MsgBox i &" "冲银 &a(i)
End Sub
Private Sub Form_Load()
Randomize
a = Array("赵", "钱", "孙", "李"磨判州, "周", "吴", "郑", "王")
End Sub
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)