
vb作业 急求VB高手!!!!!!!!!!!!!1
文件清单:
==========================================================================
★★★★form1.frm
VERSION 5.00
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 3090
ClientLeft = 60
ClientTop = 450
ClientWidth = 3690
LinkTopic = "Form1"
ScaleHeight = 3090
ScaleWidth = 3690
StartUpPosition = 3 '窗口缺省
Begin VB.Frame Frame2
Caption = "中奖号码"
Height = 735
Left = 240
TabIndex = 8
Top = 1680
Width = 3015
Begin VB.TextBox txt2
Height = 270
Index = 4
Left = 2400
TabIndex = 13
Text = "0"
Top = 240
Width = 375
End
Begin VB.TextBox txt2
Height = 270
Index = 3
Left = 1800
TabIndex = 12
Text = "0"
Top = 240
Width = 375
End
Begin VB.TextBox txt2
Height = 270
Index = 2
Left = 1320
TabIndex = 11
Text = "0"
Top = 240
Width = 375
End
Begin VB.TextBox txt2
Height = 270
Index = 1
Left = 840
TabIndex = 10
Text = "0"
Top = 240
Width = 375
End
Begin VB.TextBox txt2
Height = 270
Index = 0
Left = 240
TabIndex = 9
Text = "0"
Top = 240
Width = 375
End
End
Begin VB.Frame Frame1
Caption = "选号"
Height = 855
Left = 120
TabIndex = 1
Top = 120
Width = 3375
Begin VB.TextBox txt1
Height = 270
Index = 4
Left = 2880
TabIndex = 7
Text = "0"
Top = 360
Width = 375
End
Begin VB.TextBox txt1
Height = 270
Index = 3
Left = 2400
TabIndex = 6
Text = "0"
Top = 360
Width = 375
End
Begin VB.TextBox txt1
Height = 270
Index = 2
Left = 1920
TabIndex = 5
Text = "0"
Top = 360
Width = 375
End
Begin VB.TextBox txt1
Height = 270
Index = 1
Left = 1440
TabIndex = 4
Text = "0"
Top = 360
Width = 375
End
Begin VB.TextBox txt1
Height = 270
Index = 0
Left = 960
TabIndex = 3
Text = "0"
Top = 360
Width = 375
End
Begin VB.CommandButton Cmd1
Caption = "机选"
Height = 375
Left = 120
TabIndex = 2
Top = 240
Width = 735
End
End
Begin VB.CommandButton Cmd2
Caption = "摇奖"
Height = 375
Left = 840
TabIndex = 0
Top = 1200
Width = 1815
End
Begin VB.Label lbl
Caption = "中奖情况"
Height = 255
Left = 240
TabIndex = 14
Top = 2640
Width = 3015
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Function Xuan(d() As Integer) '产生5个随机数
On Error Resume Next
Dim a(4) As Integer
RE:
t = 0
Do
d(t) = ((30 * Rnd() \ 1) + 1)
t = t + 1
Loop Until t > 4.5
For i = 0 To 4
a(i) = d(i)
Next
For i = 0 To 4
For j = 0 To 4
If a(j) > a(i) Then
q = a(i)
a(i) = a(j)
a(j) = q
End If
Next
Next
For i = 0 To 3
If a(i) = a(i + 1) Then GoTo RE
Next
End Function
Private Sub Cmd1_Click()
Dim f(4) As Integer
Xuan f()
For i = 0 To 4
txt1(i).Text = f(i)
Next
End Sub
Private Sub Cmd2_Click()
On Error Resume Next
q = 0
For i = 0 To 4
For x = 0 To 4
If x <> i And Val(txt1(x)) = Val(txt1(i)) Then q = 1: Exit For
Next
Next
If q = 1 Then MsgBox "号有重复的;请重新选号": Exit Sub
Dim a(4) As Integer
Xuan a()
t = 0
For i = 0 To 4
txt2(i).Text = a(i)
For j = 0 To 4
If a(i) = Int(Val(txt1(j).Text)) Then t = t + 1
Next
Next
Select Case t
Case 0
lbl.Caption = "遗憾!没有中奖"
Case 1
lbl.Caption = "恭喜!您中了五等奖"
Case 2
lbl.Caption = "恭喜!您中了四等奖"
Case 3
lbl.Caption = "恭喜!您中了三等奖"
Case 4
lbl.Caption = "恭喜!您中了二等奖"
Case 5
lbl.Caption = "恭喜!!!您中了一等奖"
End Select
End Sub
=========================================================================
★★★★MSSCCPRJ.SCC
[SCC]
SCC=This is a source code control file
[工程1.vbp]
SCC_Project_Name=this project is not under source code control
SCC_Aux_Path=<This is an empty string for the mssccprj.scc file>
=========================================================================
★★★★工程1.vbp
Type=Exe
Form=Form1.frm
Reference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#C:\WINDOWS\system32\stdole2.tlb#OLE Automation
Startup="Form1"
Command32=""
Name="工程1"
HelpContextID="0"
CompatibleMode="0"
MajorVer=1
MinorVer=0
RevisionVer=0
AutoIncrementVer=0
ServerSupportFiles=0
VersionCompanyName="-"
CompilationType=0
OptimizationType=0
FavorPentiumPro(tm)=0
CodeViewDebugInfo=0
NoAliasing=0
BoundsCheck=0
OverflowCheck=0
FlPointCheck=0
FDIVCheck=0
UnroundedFP=0
StartMode=0
Unattended=0
Retained=0
ThreadPerObject=0
MaxNumberOfThreads=1
[MS Transaction Server]
AutoRefresh=1
=========================================================================
=========================================================================
共3个文件