当前位置:首页 / 班主任 / 正文

5000条让人泪奔的音乐评论。。。最怕一生碌碌无为,还说平凡难能可贵 不读书的人到底输在哪?
0

学生抽签抽组倒计时软件VB编写

班主任 | duonuli发表于2017年04月08日 | 645个浏览

学生抽签抽组倒计时软件VB编写

未命名_meitu_2.png

VB工程文件 

小组合作代码.zip

小组合作.xls

新建文件夹.zip

13班小组合作.zip

Dim js As Long

Private Declare Function Beep Lib "kernel32" (ByVal dwFreq As Long, ByVal dwDuration As Long) As Long



Private Sub Command1_Click()

Timer1.Enabled = True

Timer1.Interval = 1000 '1秒触发一次

Label1 = ""

js = 60

End Sub






Private Sub Command11_Click()

Form1.Cls

End Sub


Private Sub Timer1_Timer()


Label1 = "仅剩:" & (js \ 60) & "分" & Int(Val(js Mod 60)) & "秒"

js = js - 1

If js = 0 Then

Beep 800, 3000    ' 以80HZ的频率响2秒钟

MsgBox "时间到"


Timer1.Enabled = False

Label1.Caption = ""

End If

End Sub






Private Sub command2_Click()

Timer1.Enabled = True

Timer1.Interval = 1000 '1秒触发一次

Label1 = ""

js = 120

End Sub


Private Sub Timer2_Timer()


Label1 = "仅剩:" & (js \ 60) & "分" & Int(Val(js Mod 60)) & "秒"

js = js - 1

If js = 0 Then

Beep 800, 3000

MsgBox "时间到"


Timer1.Enabled = False

Label1.Caption = ""

End If

End Sub



Private Sub command3_Click()

Timer1.Enabled = True

Timer1.Interval = 1000 '1秒触发一次

Label1 = ""

js = 180

End Sub


Private Sub Timer3_Timer()


Label1 = "仅剩:" & (js \ 60) & "分" & Int(Val(js Mod 60)) & "秒"

js = js - 1

If js = 0 Then

Beep 800, 3000

MsgBox "时间到"


Timer1.Enabled = False

Label1.Caption = ""

End If

End Sub




Private Sub command4_Click()

Timer1.Enabled = True

Timer1.Interval = 1000 '1秒触发一次

Label1 = ""

js = 300

End Sub


Private Sub Timer4_Timer()


Label1 = "仅剩:" & (js \ 60) & "分" & Int(Val(js Mod 60)) & "秒"

js = js - 1

If js = 0 Then

Beep 800, 3000

MsgBox "时间到"


Timer1.Enabled = False

Label1.Caption = ""

End If

End Sub




Private Sub command5_Click()

Timer1.Enabled = True

Timer1.Interval = 1000 '1秒触发一次

Label1 = ""

js = 360

End Sub


Private Sub Timer5_Timer()


Label1 = "仅剩:" & (js \ 60) & "分" & Int(Val(js Mod 60)) & "秒"

js = js - 1

If js = 0 Then

Beep 800, 3000

MsgBox "时间到"


Timer1.Enabled = False

Label1.Caption = ""

End If

End Sub



Private Sub command6_Click()

Timer1.Enabled = True

Timer1.Interval = 1000 '1秒触发一次

Label1 = ""

js = 480

End Sub


Private Sub Timer6_Timer()


Label1 = "仅剩:" & (js \ 60) & "分" & Int(Val(js Mod 60)) & "秒后关闭"

js = js - 1

If js = 0 Then

Beep 800, 3000

MsgBox "时间到"


Timer1.Enabled = False

Label1.Caption = ""

End If

End Sub




Private Sub command7_Click()

Timer1.Enabled = True

Timer1.Interval = 1000 '1秒触发一次

Label1 = ""

js = 600

End Sub


Private Sub Timer7_Timer()


Label1 = "仅剩:" & (js \ 60) & "分" & Int(Val(js Mod 60)) & "秒"

js = js - 1

If js = 0 Then

Beep 800, 3000

MsgBox "时间到"


Timer1.Enabled = False

Label1.Caption = ""

End If

End Sub




Private Sub command8_Click()

Timer1.Enabled = True

Timer1.Interval = 1000 '1秒触发一次

Label1 = ""

js = 900

End Sub


Private Sub Timer8_Timer()


Label1 = "仅剩:" & (js \ 60) & "分" & Int(Val(js Mod 60)) & "秒后关闭"

js = js - 1

If js = 0 Then

Beep 800, 3000

MsgBox "时间到"


Timer1.Enabled = False

Label1.Caption = ""

End If

End Sub



Private Sub Command9_Click()

Form1.Cls

Dim a(1 To 127) As String




Randomize

'防止每次生出随机数一样

Print a(Int(Rnd * 127) + 1)

'rnd()生成[0,1)的随机数,int()是取整

End Sub



Private Sub Command10_Click()


Dim b(1 To 2) As String

b(1) = "左"

b(2) = "右"

Randomize

Print Int(Rnd * 8) + 1

'防止每次生出随机数一样

Print b(Int(Rnd * 2) + 1)

'rnd()生成[0,1)的随机数,int()是取整

End Sub


推荐您阅读更多有关于“班主任 ”的文章

猜你喜欢

本文暂时没有评论,来添加一个吧(●'◡'●)

欢迎 发表评论: