【VB开源代码栏目提醒】:网学会员VB开源代码为您提供Ex3_2.frm参考,解决您在Ex3_2.frm学习中工作中的难题,参考学习。
VERSION 5.00
Begin VB.Form Ex3_2
Caption = "Form1"
ClientHeight = 1680
ClientLeft = 60
ClientTop = 450
ClientWidth = 3750
LinkTopic = "Form1"
ScaleHeight = 1680
ScaleWidth = 3750
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command1
Caption = "
查询"
Height = 375
Left = 1200
TabIndex = 2
Top = 960
Width = 855
End
Begin VB.TextBox Text1
Height = 375
Left = 1680
TabIndex = 1
Top = 240
Width = 1815
End
Begin
VB.Label Label1
Caption = "请输入您的号码"
Height = 255
Left = 240
TabIndex = 0
Top = 360
Width = 1335
End
End
Attribute VB_Name = "Ex3_2"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Dim iInput As Integer '定义整型变量
iInput = Text1.Text
Select Case iInput '测试变量iTnput的值
Case 456 '若iTnput的值为456则显示下面的消息
MsgBox ("恭喜你,中了一等奖!")
Case 400, 410, 457 To 500
'若iTnput的值为400、410或在457到500之间则显示下面的消息
MsgBox ("恭喜你,中了二等奖!")
Case 401 To 409, 501 To 600
'若iTnput的值在401和409之间或在501到600之间则显示下面的消息
MsgBox ("恭喜你,中了三等奖!")
Case Else
MsgBox ("谢谢你的参与!")
End Select
End Sub