⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 队员信息.frm

📁 河北工业大学大一至大二学期
💻 FRM
字号:
VERSION 5.00
Begin VB.Form frmFootBall 
   Caption         =   "排出场名单"
   ClientHeight    =   2625
   ClientLeft      =   675
   ClientTop       =   1770
   ClientWidth     =   6480
   LinkTopic       =   "Form1"
   ScaleHeight     =   2625
   ScaleWidth      =   6480
   Begin VB.PictureBox picCtn 
      BorderStyle     =   0  'None
      Height          =   2610
      Left            =   6600
      ScaleHeight     =   2610
      ScaleWidth      =   3495
      TabIndex        =   15
      Top             =   0
      Width           =   3495
      Begin VB.PictureBox pic 
         Appearance      =   0  'Flat
         BackColor       =   &H80000016&
         ForeColor       =   &H80000008&
         Height          =   1815
         Left            =   480
         ScaleHeight     =   1785
         ScaleWidth      =   2625
         TabIndex        =   16
         Top             =   240
         Width           =   2655
         Begin VB.Label dy 
            Alignment       =   2  'Center
            Appearance      =   0  'Flat
            BackColor       =   &H80000005&
            ForeColor       =   &H80000008&
            Height          =   255
            Index           =   0
            Left            =   720
            TabIndex        =   27
            Top             =   960
            Width           =   255
         End
         Begin VB.Label dy 
            Alignment       =   2  'Center
            Appearance      =   0  'Flat
            BackColor       =   &H80000005&
            ForeColor       =   &H80000008&
            Height          =   255
            Index           =   1
            Left            =   480
            TabIndex        =   26
            Top             =   0
            Width           =   255
         End
         Begin VB.Label dy 
            Alignment       =   2  'Center
            Appearance      =   0  'Flat
            BackColor       =   &H80000005&
            ForeColor       =   &H80000008&
            Height          =   255
            Index           =   2
            Left            =   1200
            TabIndex        =   25
            Top             =   1440
            Width           =   255
         End
         Begin VB.Label dy 
            Alignment       =   2  'Center
            Appearance      =   0  'Flat
            BackColor       =   &H80000005&
            ForeColor       =   &H80000008&
            Height          =   255
            Index           =   3
            Left            =   1200
            TabIndex        =   24
            Top             =   0
            Width           =   255
         End
         Begin VB.Label dy 
            Alignment       =   2  'Center
            Appearance      =   0  'Flat
            BackColor       =   &H80000005&
            ForeColor       =   &H80000008&
            Height          =   255
            Index           =   4
            Left            =   1920
            TabIndex        =   23
            Top             =   0
            Width           =   255
         End
         Begin VB.Label dy 
            Alignment       =   2  'Center
            Appearance      =   0  'Flat
            BackColor       =   &H80000005&
            ForeColor       =   &H80000008&
            Height          =   255
            Index           =   5
            Left            =   240
            TabIndex        =   22
            Top             =   1200
            Width           =   255
         End
         Begin VB.Label dy 
            Alignment       =   2  'Center
            Appearance      =   0  'Flat
            BackColor       =   &H80000005&
            ForeColor       =   &H80000008&
            Height          =   255
            Index           =   6
            Left            =   240
            TabIndex        =   21
            Top             =   480
            Width           =   255
         End
         Begin VB.Label dy 
            Alignment       =   2  'Center
            Appearance      =   0  'Flat
            BackColor       =   &H80000005&
            ForeColor       =   &H80000008&
            Height          =   255
            Index           =   7
            Left            =   960
            TabIndex        =   20
            Top             =   480
            Width           =   255
         End
         Begin VB.Label dy 
            Alignment       =   2  'Center
            Appearance      =   0  'Flat
            BackColor       =   &H80000005&
            ForeColor       =   &H80000008&
            Height          =   255
            Index           =   8
            Left            =   1560
            TabIndex        =   19
            Top             =   480
            Width           =   255
         End
         Begin VB.Label dy 
            Alignment       =   2  'Center
            Appearance      =   0  'Flat
            BackColor       =   &H80000005&
            ForeColor       =   &H80000008&
            Height          =   255
            Index           =   9
            Left            =   2160
            TabIndex        =   18
            Top             =   480
            Width           =   255
         End
         Begin VB.Label dy 
            Alignment       =   2  'Center
            Appearance      =   0  'Flat
            BackColor       =   &H80000005&
            ForeColor       =   &H80000008&
            Height          =   255
            Index           =   10
            Left            =   1680
            TabIndex        =   17
            Top             =   960
            Width           =   255
         End
      End
      Begin VB.Label Label2 
         Appearance      =   0  'Flat
         BackColor       =   &H80000005&
         BackStyle       =   0  'Transparent
         BorderStyle     =   1  'Fixed Single
         ForeColor       =   &H80000008&
         Height          =   375
         Left            =   480
         TabIndex        =   29
         Top             =   -120
         Width           =   2655
      End
      Begin VB.Label Label1 
         Appearance      =   0  'Flat
         BackColor       =   &H80000016&
         BorderStyle     =   1  'Fixed Single
         ForeColor       =   &H80000008&
         Height          =   135
         Left            =   1680
         TabIndex        =   28
         Top             =   2040
         Width           =   255
      End
   End
   Begin VB.CommandButton Command3 
      Caption         =   "重新开始"
      Enabled         =   0   'False
      Height          =   375
      Left            =   4440
      TabIndex        =   14
      Top             =   2040
      Width           =   1335
   End
   Begin VB.CommandButton Command2 
      Caption         =   "GO!"
      Enabled         =   0   'False
      Height          =   375
      Left            =   5280
      TabIndex        =   13
      Top             =   1560
      Width           =   975
   End
   Begin VB.CommandButton Command1 
      Caption         =   "读入队员信息"
      Height          =   375
      Left            =   3720
      TabIndex        =   12
      Top             =   1560
      Width           =   1455
   End
   Begin VB.Frame Frame1 
      Caption         =   "请选择阵形"
      Height          =   1335
      Left            =   3720
      TabIndex        =   5
      Top             =   120
      Width           =   2535
      Begin VB.OptionButton opt 
         Caption         =   "361 阵形"
         Height          =   255
         Index           =   5
         Left            =   1320
         TabIndex        =   11
         Top             =   960
         Width           =   1095
      End
      Begin VB.OptionButton opt 
         Caption         =   "343 阵形"
         Height          =   255
         Index           =   4
         Left            =   1320
         TabIndex        =   10
         Top             =   600
         Width           =   1095
      End
      Begin VB.OptionButton opt 
         Caption         =   "532 阵形"
         Height          =   255
         Index           =   3
         Left            =   1320
         TabIndex        =   9
         Top             =   240
         Width           =   1095
      End
      Begin VB.OptionButton opt 
         Caption         =   "352 阵形"
         Height          =   255
         Index           =   2
         Left            =   120
         TabIndex        =   8
         Top             =   960
         Width           =   1095
      End
      Begin VB.OptionButton opt 
         Caption         =   "442 阵形"
         Height          =   255
         Index           =   1
         Left            =   120
         TabIndex        =   7
         Top             =   600
         Width           =   1095
      End
      Begin VB.OptionButton opt 
         Caption         =   "433 阵形"
         Height          =   255
         Index           =   0
         Left            =   120
         TabIndex        =   6
         Top             =   240
         Value           =   -1  'True
         Width           =   1095
      End
   End
   Begin VB.CommandButton cmdclear 
      Caption         =   "<<"
      Height          =   375
      Left            =   1560
      TabIndex        =   4
      Top             =   1680
      Width           =   495
   End
   Begin VB.CommandButton cmdOUT 
      Caption         =   "<-"
      Height          =   375
      Left            =   1560
      TabIndex        =   3
      Top             =   1080
      Width           =   495
   End
   Begin VB.CommandButton cmdIN 
      Caption         =   "->"
      Height          =   375
      Left            =   1560
      TabIndex        =   2
      Top             =   480
      Width           =   495
   End
   Begin VB.ListBox List2 
      Height          =   2220
      Left            =   2160
      TabIndex        =   1
      Top             =   120
      Width           =   1335
   End
   Begin VB.ListBox List1 
      Height          =   2220
      Left            =   120
      TabIndex        =   0
      Top             =   120
      Width           =   1335
   End
End
Attribute VB_Name = "frmFootBall"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim strPos(1000) As String, iNum(1000) As Long, qf As Long, qw As Long, hw As Long, mj As Long
Dim Mqw As Long, Mqf As Long, Mhw As Long, lo As Long
Dim pqw As Long, pqf As Long, phw As Long

Private Sub cmdclear_Click()
Dim i As Long
For i = 0 To List2.ListCount - 1
    List1.AddItem List2.List(i)
Next
List2.Clear
End Sub

Private Sub cmdIN_Click()
If List1.ListIndex = -1 Then MsgBox "请选择出场的队员": Exit Sub
Dim t As String
t = List1.List(List1.ListIndex)
Select Case Right(List1.List(List1.ListIndex), 2)
Case "门员"
    If mj > 0 Then MsgBox "已选购守门员": Exit Sub Else mj = 1
    dy(10).Caption = getNum(t)
Case "前锋"
    If qf >= Mqf Then MsgBox "已选够前锋": Exit Sub Else qf = qf + 1
    dy(pqf).Caption = getNum(t)
    pqf = pqf + 1
Case "前卫"
    If qw >= Mqw Then MsgBox "已选够前卫": Exit Sub Else qw = qw + 1
    dy(Mqf + pqw).Caption = getNum(t)
    pqw = pqw + 1
Case "后卫"
    If hw >= Mhw Then MsgBox "已选够后卫": Exit Sub Else hw = hw + 1
    dy(Mqf + Mqw + phw).Caption = getNum(t)
    phw = phw + 1
End Select
List2.AddItem t
List1.RemoveItem List1.ListIndex
End Sub

Function getNum(ByVal a As String) As Long
Do Until Val(Left(a, 1)) <> 0 Or a = ""
a = Right(a, Len(a) - 1)
Loop
getNum = Val(a)
End Function

Private Sub cmdOUT_Click()
If List2.ListIndex = -1 Then MsgBox "请选择退场的队员": Exit Sub
Select Case Right(List2.List(List2.ListIndex), 2)
Case "门员"
     mj = 0
Case "前锋"
    qf = qf - 1
    pqf = pqf - 1
Case "前卫"
    qw = qw - 1
    pqw = pqw - 1
Case "后卫"
    hw = hw - 1
    phw = phw - 1
End Select
List1.AddItem List2.List(List2.ListIndex)
List2.RemoveItem List2.ListIndex
End Sub

Private Sub Command1_Click()
Command1.Enabled = False
Dim t As String
Open Command & "mumber.txt" For Input As #1
Do Until EOF(1)
    Input #1, t
    List1.AddItem t
    Input #1, t
    strPos(List1.ListCount) = t
    Input #1, t
    iNum(List1.ListCount) = Val(t)
Loop
Close #1
Command2.Enabled = True
End Sub

Private Sub Command2_Click()
If List2.ListCount <> 11 Then MsgBox "尚未选够出场队员" Else picCtn.Left = 0: Command3.Enabled = True: Command2.Enabled = False
End Sub

Private Sub Command3_Click()
Command1.Enabled = True
Command3.Enabled = False
picCtn.Left = 6600
List1.Clear
List2.Clear
pqw = 0: phw = 0: pqf = 0
qw = 0: hw = 0: qf = 0
End Sub

Private Sub Form_Load()
opt_Click (0)
End Sub

Private Sub opt_Click(Index As Integer)
Dim a As Long
With opt(Index)
a = Val(Mid(.Caption, 3, 1))
If a < qf Then
    MsgBox "您当前已选择超过" & a & "个前锋,请进行移除后再选择"
    opt(lo).Value = True
    Exit Sub
Else
    Mqf = a
End If
a = Val(Mid(.Caption, 2, 1))
If a < qw Then
    MsgBox "您当前已选择超过" & a & "个前卫,请进行移除后再选择"
    opt(lo).Value = True
    Exit Sub
Else
    Mqw = a
End If
a = Val(Mid(.Caption, 1, 1))
If a < hw Then
    MsgBox "您当前已选择超过" & a & "个后卫,请进行移除后再选择"
    opt(lo).Value = True
    Exit Sub
Else
    Mhw = a
End If
End With
lo = Index
For i = 0 To Mqf - 1
    dy(i).Left = vl(Mqf) + i * vs(Mqf)
    dy(i).Top = 0
Next
For i = 0 To Mqw - 1
    dy(i + Mqf).Left = vl(Mqw) + i * vs(Mqw)
    dy(i + Mqf).Top = 480
Next
For i = 0 To Mhw - 1
    dy(i + Mqf + Mqw).Left = vl(Mhw) + i * vs(Mhw)
    dy(i + Mqf + Mqw).Top = 960
Next
dy(10).Left = 1200
dy(10).Top = 480 * 3
ReaddMem
End Sub

Function vs(num As Long)
vs = (2400 - vl(num)) / num + 255 / num
End Function

Function vl(num As Long)
Select Case num
Case 1
    vl = 1200
Case 2
    vl = 720
Case 3
    vl = 480
Case 4, 5
    vl = 240
End Select
End Function

Sub ReaddMem()
pqf = 0
phw = 0
pqw = 0
For i = 0 To List2.ListCount - 1
t = List2.List(i)
Select Case Right(t, 2)
Case "门员"
    dy(10).Caption = getNum(t)
Case "前锋"
    dy(pqf).Caption = getNum(t)
    pqf = pqf + 1
Case "前卫"
    dy(Mqf + pqw).Caption = getNum(t)
    pqw = pqw + 1
Case "后卫"
    dy(Mqf + Mqw + phw).Caption = getNum(t)
    phw = phw + 1
End Select
Next
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -