VERSION 5.00
Begin VB.Form Frmcpdf 
   BackColor       =   &H00C0FFFF&
   BorderStyle     =   1  'Fixed Single
   Caption         =   "比赛打分"
   ClientHeight    =   2835
   ClientLeft      =   45
   ClientTop       =   435
   ClientWidth     =   3960
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   2835
   ScaleWidth      =   3960
   StartUpPosition =   3  '窗口缺省
   Begin VB.Frame Frame1 
      Caption         =   "运动员分数统计"
      Height          =   1335
      Left            =   120
      TabIndex        =   23
      Top             =   2880
      Width           =   3735
      Begin VB.CommandButton Cmdpj 
         Caption         =   "平均分"
         Height          =   375
         Left            =   240
         TabIndex        =   25
         Top             =   840
         Width           =   1575
      End
      Begin VB.CommandButton CmdSum 
         Caption         =   "总分"
         Height          =   375
         Left            =   240
         TabIndex        =   24
         Top             =   360
         Width           =   1575
      End
      Begin VB.Label Lbl2 
         Alignment       =   2  'Center
         BorderStyle     =   1  'Fixed Single
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   10.5
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   2040
         TabIndex        =   27
         Top             =   840
         Width           =   1335
      End
      Begin VB.Label Lbl1 
         Alignment       =   2  'Center
         BorderStyle     =   1  'Fixed Single
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   10.5
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   2040
         TabIndex        =   26
         Top             =   360
         Width           =   1335
      End
   End
   Begin VB.Frame Fradafen 
      BackColor       =   &H00C0FFFF&
      Caption         =   "为运动员打分"
      Height          =   2655
      Left            =   120
      TabIndex        =   0
      Top             =   120
      Width           =   3735
      Begin VB.CommandButton Cmdqch 
         BackColor       =   &H00C0FFC0&
         Caption         =   "清除"
         Height          =   375
         Left            =   1920
         Style           =   1  'Graphical
         TabIndex        =   20
         Top             =   2160
         Width           =   1575
      End
      Begin VB.CommandButton Cmdmndf 
         BackColor       =   &H00C0FFC0&
         Caption         =   "模拟打分"
         Height          =   375
         Left            =   240
         Style           =   1  'Graphical
         TabIndex        =   19
         Top             =   2160
         Width           =   1575
      End
      Begin VB.TextBox Text 
         Alignment       =   2  'Center
         Height          =   270
         Index           =   9
         Left            =   2880
         TabIndex        =   10
         Text            =   "Text1"
         Top             =   1800
         Width           =   615
      End
      Begin VB.TextBox Text 
         Alignment       =   2  'Center
         Height          =   270
         Index           =   8
         Left            =   2880
         TabIndex        =   9
         Text            =   "Text1"
         Top             =   1440
         Width           =   615
      End
      Begin VB.TextBox Text 
         Alignment       =   2  'Center
         Height          =   270
         Index           =   7
         Left            =   2880
         TabIndex        =   8
         Text            =   "Text1"
         Top             =   1080
         Width           =   615
      End
      Begin VB.TextBox Text 
         Alignment       =   2  'Center
         Height          =   270
         Index           =   6
         Left            =   2880
         TabIndex        =   7
         Text            =   "Text1"
         Top             =   720
         Width           =   615
      End
      Begin VB.TextBox Text 
         Alignment       =   2  'Center
         Height          =   270
         Index           =   5
         Left            =   2880
         TabIndex        =   6
         Text            =   "Text1"
         Top             =   360
         Width           =   615
      End
      Begin VB.TextBox Text 
         Alignment       =   2  'Center
         Height          =   270
         Index           =   4
         Left            =   840
         TabIndex        =   5
         Text            =   "Text1"
         Top             =   1800
         Width           =   615
      End
      Begin VB.TextBox Text 
         Alignment       =   2  'Center
         Height          =   270
         Index           =   3
         Left            =   840
         TabIndex        =   4
         Text            =   "Text1"
         Top             =   1440
         Width           =   615
      End
      Begin VB.TextBox Text 
         Alignment       =   2  'Center
         Height          =   270
         Index           =   2
         Left            =   840
         TabIndex        =   3
         Text            =   "Text1"
         Top             =   1080
         Width           =   615
      End
      Begin VB.TextBox Text 
         Alignment       =   2  'Center
         Height          =   270
         Index           =   1
         Left            =   840
         TabIndex        =   2
         Text            =   "Text1"
         Top             =   720
         Width           =   615
      End
      Begin VB.TextBox Text 
         Alignment       =   2  'Center
         Height          =   270
         Index           =   0
         Left            =   840
         TabIndex        =   1
         Text            =   "Text1"
         Top             =   360
         Width           =   615
      End
      Begin VB.Label Lbl 
         Alignment       =   2  'Center
         BackColor       =   &H00C0FFFF&
         Caption         =   "Label1"
         Height          =   255
         Index           =   9
         Left            =   2160
         TabIndex        =   22
         Top             =   1800
         Width           =   735
      End
      Begin VB.Label Lbl 
         Alignment       =   2  'Center
         BackColor       =   &H00C0FFFF&
         Caption         =   "Label1"
         Height          =   255
         Index           =   7
         Left            =   2160
         TabIndex        =   21
         Top             =   1080
         Width           =   735
      End
      Begin VB.Label Lbl 
         Alignment       =   2  'Center
         BackColor       =   &H00C0FFFF&
         Caption         =   "Label1"
         Height          =   255
         Index           =   8
         Left            =   2160
         TabIndex        =   18
         Top             =   1440
         Width           =   735
      End
      Begin VB.Label Lbl 
         Alignment       =   2  'Center
         BackColor       =   &H00C0FFFF&
         Caption         =   "Label1"
         Height          =   255
         Index           =   6
         Left            =   2160
         TabIndex        =   17
         Top             =   720
         Width           =   735
      End
      Begin VB.Label Lbl 
         Alignment       =   2  'Center
         BackColor       =   &H00C0FFFF&
         Caption         =   "Label1"
         Height          =   255
         Index           =   5
         Left            =   2160
         TabIndex        =   16
         Top             =   360
         Width           =   735
      End
      Begin VB.Label Lbl 
         Alignment       =   2  'Center
         BackColor       =   &H00C0FFFF&
         Caption         =   "Label1"
         Height          =   255
         Index           =   4
         Left            =   120
         TabIndex        =   15
         Top             =   1800
         Width           =   735
      End
      Begin VB.Label Lbl 
         Alignment       =   2  'Center
         BackColor       =   &H00C0FFFF&
         Caption         =   "Label1"
         Height          =   255
         Index           =   3
         Left            =   120
         TabIndex        =   14
         Top             =   1440
         Width           =   735
      End
      Begin VB.Label Lbl 
         Alignment       =   2  'Center
         BackColor       =   &H00C0FFFF&
         Caption         =   "Label1"
         Height          =   255
         Index           =   2
         Left            =   120
         TabIndex        =   13
         Top             =   1080
         Width           =   735
      End
      Begin VB.Label Lbl 
         Alignment       =   2  'Center
         BackColor       =   &H00C0FFFF&
         Caption         =   "Label1"
         Height          =   255
         Index           =   1
         Left            =   120
         TabIndex        =   12
         Top             =   720
         Width           =   735
      End
      Begin VB.Label Lbl 
         Alignment       =   2  'Center
         BackColor       =   &H00C0FFFF&
         Caption         =   "Label1"
         Height          =   255
         Index           =   0
         Left            =   120
         TabIndex        =   11
         Top             =   360
         Width           =   735
      End
   End
End
Attribute VB_Name = "Frmcpdf"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim Sum As Single       '定义存放总分的变量
Rem 初始化程序
Private Sub Form_Load()
  For i = 0 To 9
    Lbl(i).Caption = "裁判" + CStr(i + 1)   '为裁判编号的控件数组设置标识属性
    Text(i).Text = 0           '裁判打出分数的控件数组设置文本属性
  Next i
End Sub
Rem 模拟打分
Private Sub Cmdmndf_Click()
  Dim r As Single
  Randomize               '随机数序列初始化
  For i = 0 To 9
    r = Rnd * 2 + 8       '产生(8,10)之间的随机小数
    Text(i).Text = Fix(r * 100 + 0.5) / 100  '按四舍五入保留小数点后两位小数
  Next i
End Sub
Rem 求总分
Private Sub CmdSum_Click()
  Sum = 0
  For i = 0 To 9
    Sum = Sum + Text(i).Text   '累加总分
  Next i
  Lbl1.Caption = Fix(Sum * 100 + 0.5) / 100    '按四舍五入保留小数点后两位小数
End Sub
Rem 求平均分
Private Sub Cmdpj_Click()
  Dim Av As Single
  Sum = 0
  For i = 0 To 9
    Sum = Sum + Text(i).Text
  Next i
  Av = Sum / 10
  Lbl2.Caption = Fix(Av * 100 + 0.5) / 100
End Sub
Rem 清除
Private Sub Cmdqch_Click()
  For i = 0 To 9
    Text(i).Text = 0
  Next i
  Lbl1.Caption = ""
  Lbl2.Caption = ""
End Sub
Private Sub Form_Unload(Cancel As Integer)
   Unload Me
   Frmsys.Show
End Sub
