电话号码抽奖VB程序
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
Private Sub Command1_Click()
Command1.Visible = False
Timer1.Enabled = True
End Sub
Private Sub Command2_Click()
If Command2.Caption = "停止" Then
Timer1.Enabled = False
Command2.Caption = "继续"
Else
Command2.Caption = "停止"
Timer1.Enabled = True
End If
If Timer1.Enabled = False Then MsgBox Label2.Caption
End Sub
Private Sub Form_Load()
Timer1.Enabled = False
End Sub
Private Sub Timer1_Timer()
If Label2.Top > 0 Then
Label2.Top = Label2.Top - Label2.Height
Else
Label2.Top = Label2.Top + 7 * Label2.Height
End If
Dim a As String, b As Integer, c As String
b = Int(Rand(3, 1))
Select Case b
Case 1
c = "3"
Case 2
c = "5"
Case 3
c = "8"
End Select
a = "1" + c + Rand(9, 0) + Rand(9, 0) + Rand(9, 0) + Rand(9, 0) + Rand(9, 0) + Rand(9, 0) + Rand(9, 0) + Rand(9, 0) + Rand(9, 0)
Label2.Caption = a
Label2.ForeColor = &HFF&
End Sub
Function Rand(U1, B1) As String Rand = CStr(Int(Rnd * (U1 - B1) + B1)) End Function