?? 隊(duì)員信息.frm
字號(hào):
VERSION 5.00
Begin VB.Form frmFootBall
Caption = "排出場(chǎng)名單"
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 = "讀入隊(duì)員信息"
Height = 375
Left = 3720
TabIndex = 12
Top = 1560
Width = 1455
End
Begin VB.Frame Frame1
Caption = "請(qǐng)選擇陣形"
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 "請(qǐng)選擇出場(chǎng)的隊(duì)員": 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 "已選購(gòu)守門員": 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 "前衛(wèi)"
If qw >= Mqw Then MsgBox "已選夠前衛(wèi)": Exit Sub Else qw = qw + 1
dy(Mqf + pqw).Caption = getNum(t)
pqw = pqw + 1
Case "后衛(wèi)"
If hw >= Mhw Then MsgBox "已選夠后衛(wèi)": 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 "請(qǐng)選擇退場(chǎng)的隊(duì)員": Exit Sub
Select Case Right(List2.List(List2.ListIndex), 2)
Case "門員"
mj = 0
Case "前鋒"
qf = qf - 1
pqf = pqf - 1
Case "前衛(wèi)"
qw = qw - 1
pqw = pqw - 1
Case "后衛(wèi)"
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 "尚未選夠出場(chǎng)隊(duì)員" 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 "您當(dāng)前已選擇超過(guò)" & a & "個(gè)前鋒,請(qǐng)進(jìn)行移除后再選擇"
opt(lo).Value = True
Exit Sub
Else
Mqf = a
End If
a = Val(Mid(.Caption, 2, 1))
If a < qw Then
MsgBox "您當(dāng)前已選擇超過(guò)" & a & "個(gè)前衛(wèi),請(qǐng)進(jìn)行移除后再選擇"
opt(lo).Value = True
Exit Sub
Else
Mqw = a
End If
a = Val(Mid(.Caption, 1, 1))
If a < hw Then
MsgBox "您當(dāng)前已選擇超過(guò)" & a & "個(gè)后衛(wèi),請(qǐng)進(jìn)行移除后再選擇"
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 "前衛(wèi)"
dy(Mqf + pqw).Caption = getNum(t)
pqw = pqw + 1
Case "后衛(wèi)"
dy(Mqf + Mqw + phw).Caption = getNum(t)
phw = phw + 1
End Select
Next
End Sub
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -