📄 mainform.frm
字号:
VERSION 5.00
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
Begin VB.Form MainForm
Caption = "NBA数据查询系统"
ClientHeight = 6720
ClientLeft = 165
ClientTop = 540
ClientWidth = 9825
Icon = "MainForm.frx":0000
LinkTopic = "Form2"
LockControls = -1 'True
ScaleHeight = 6720
ScaleWidth = 9825
WindowState = 2 'Maximized
Begin VB.Timer Timer1
Interval = 2000
Left = 7680
Top = 480
End
Begin MSComDlg.CommonDialog CommonDialog1
Left = 9000
Top = -120
_ExtentX = 847
_ExtentY = 847
_Version = 393216
DialogTitle = "打开数据库"
Filter = "数据库文件|*.mdb|所有文件|*.*"
InitDir = "D:\新建文件夹\My Documents\demo"
End
Begin VB.Image Image1
Height = 4695
Index = 3
Left = 6000
Picture = "MainForm.frx":5882
Stretch = -1 'True
Top = 3120
Visible = 0 'False
Width = 3855
End
Begin VB.Image Image1
Height = 5535
Index = 7
Left = 3360
Picture = "MainForm.frx":E865
Stretch = -1 'True
Top = 4440
Visible = 0 'False
Width = 3855
End
Begin VB.Image Image1
Height = 5895
Index = 6
Left = 9960
Picture = "MainForm.frx":16844
Stretch = -1 'True
Top = 840
Visible = 0 'False
Width = 4695
End
Begin VB.Image Image1
Height = 4335
Index = 5
Left = 8280
Picture = "MainForm.frx":1F586
Stretch = -1 'True
Top = 4920
Visible = 0 'False
Width = 3375
End
Begin VB.Image Image1
Height = 5415
Index = 4
Left = 1800
Picture = "MainForm.frx":27B37
Stretch = -1 'True
Top = 1080
Visible = 0 'False
Width = 4215
End
Begin VB.Image Image1
Height = 6015
Index = 2
Left = 7080
Picture = "MainForm.frx":30945
Stretch = -1 'True
Top = 960
Visible = 0 'False
Width = 4815
End
Begin VB.Image Image1
Height = 4695
Index = 1
Left = 960
Picture = "MainForm.frx":38754
Stretch = -1 'True
Top = 3960
Visible = 0 'False
Width = 3735
End
Begin VB.Image Image1
Height = 5055
Index = 8
Left = 720
Picture = "MainForm.frx":41B06
Stretch = -1 'True
Top = 840
Visible = 0 'False
Width = 4095
End
Begin VB.Image Image1
Height = 10725
Index = 0
Left = 0
Picture = "MainForm.frx":49064
Stretch = -1 'True
Top = 0
Width = 15360
End
Begin VB.Menu file
Caption = "系统菜单"
Begin VB.Menu open
Caption = "打开数据库"
End
Begin VB.Menu admin
Caption = "管理员登录"
End
Begin VB.Menu shut1
Caption = "-"
End
Begin VB.Menu exit
Caption = "退出程序"
End
End
Begin VB.Menu data
Caption = "数据一览"
Begin VB.Menu player_info
Caption = "球员信息"
End
Begin VB.Menu team_info
Caption = "球队信息"
End
Begin VB.Menu coach_info
Caption = "教练信息"
End
Begin VB.Menu match_info
Caption = "比赛信息"
End
End
Begin VB.Menu search
Caption = "资料查询"
Begin VB.Menu player_s
Caption = "球员查询"
End
Begin VB.Menu team_s
Caption = "球队查询"
End
Begin VB.Menu coach_s
Caption = "教练查询"
End
Begin VB.Menu match_s
Caption = "比赛查询"
End
End
Begin VB.Menu statistics
Caption = "数据统计"
Begin VB.Menu player_st
Caption = "球员数据统计"
End
Begin VB.Menu team_st
Caption = "球队数据统计"
End
End
Begin VB.Menu manage
Caption = "数据库管理"
Begin VB.Menu player_add
Caption = "球员管理"
End
Begin VB.Menu player_change
Caption = "转会管理"
End
Begin VB.Menu coach_add
Caption = "教练管理"
End
Begin VB.Menu team_add
Caption = "球队管理"
End
Begin VB.Menu text_add
Caption = "添加文字记录"
End
End
Begin VB.Menu order
Caption = "各项排名"
Begin VB.Menu team_o
Caption = "球队排名"
End
Begin VB.Menu player_o
Caption = "球员数据统计排名"
End
Begin VB.Menu teams_o
Caption = "球队数据统计排名"
End
End
Begin VB.Menu advance
Caption = "高级"
Begin VB.Menu control
Caption = "控制台"
End
End
Begin VB.Menu help
Caption = "帮助"
Begin VB.Menu faq
Caption = "FAQ"
End
Begin VB.Menu shut2
Caption = "-"
End
Begin VB.Menu about
Caption = "关于"
End
End
End
Attribute VB_Name = "MainForm"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim num, newn As Integer '处理随机图片编号
Private Sub about_Click()
aboutForm.Show
End Sub
Private Sub admin_Click()
'获得管理员权限
Dim password As String
If status > 0 Then
password = InputBox("请输入管理员密码:", "口令")
If password = "NBA" Then
status = 2
Call root
End If
End If
End Sub
Private Sub coach_add_Click()
'教练修改窗口
CoachForm.Command1.Enabled = True
CoachForm.Command2.Enabled = True
For i = 0 To 7
CoachForm.Text1(i).Locked = True
Next i
CoachForm.Image1.Enabled = False
CoachForm.Show
End Sub
Private Sub coach_info_Click()
'教练修改窗口
CoachForm.Command1.Enabled = False
CoachForm.Command2.Enabled = False
For i = 0 To 7
CoachForm.Text1(i).Locked = True
Next i
CoachForm.Image1.Enabled = False
CoachForm.Show
End Sub
Private Sub coach_s_Click()
'教练查询
CoachSearch.Show
End Sub
Private Sub control_Click()
'控制台
ComForm.Show
End Sub
Private Sub exit_Click()
'退出
Unload Me
End Sub
Private Sub faq_Click()
r = ShellExecute(hwnd, "OPEN", "Readme.html", vbNullString, "\..\NBADataBase", SW_SHOW)
End Sub
Private Sub Form_Load()
status = 0 '没有任何操作权限
'1为一般权限
'2为管理员权限
Call root
num = 1
newn = 1
PlayerSQLStr = "Select * from Player"
TeamSQLStr = "Select * from Team"
CoachSQLStr = "Select *from Coach"
End Sub
Private Sub Form_Unload(Cancel As Integer)
End
End Sub
Private Sub match_info_Click()
MsgBox ("由于数据有限,未提供此功能,但实现和统计相同。")
End Sub
Private Sub match_s_Click()
MsgBox ("由于于数据有限,未提供此功能。")
End Sub
Private Sub open_Click()
'载入数据库文件
CommonDialog1.Action = 1
dbpath = CommonDialog1.FileName
exepath = CommonDialog1.InitDir
If CommonDialog1.FileName <> "" Then
status = 1
Call root
End If
End Sub
Private Sub player_add_Click()
'球员修改
PlayerForm.Command1.Enabled = True
PlayerForm.Command2.Enabled = True
For i = 0 To 10
PlayerForm.Text1(i).Locked = True
Next i
PlayerForm.Image1.Enabled = False
PlayerForm.Show
End Sub
Private Sub player_change_Click()
PlayerChange.Show
End Sub
Private Sub player_info_Click()
'球员信息
PlayerForm.Command1.Enabled = False
PlayerForm.Command2.Enabled = False
For i = 0 To 10
PlayerForm.Text1(i).Locked = True
Next i
PlayerForm.Image1.Enabled = False
PlayerForm.Show
End Sub
Private Sub player_o_Click()
'球员排名
PlayerOrder.Show
End Sub
Private Sub player_s_Click()
'球员查找
PlayerSearch.Show
End Sub
Private Sub player_st_Click()
'球员统计
PlayerStatistics.Show
End Sub
Private Sub save_Click()
MsgBox ("未提供此项功能!")
End Sub
Private Sub team_add_Click()
'球队修改
TeamForm.Command1.Enabled = True
TeamForm.Command2.Enabled = True
For i = 0 To 7
TeamForm.Text1(i).Locked = True
Next i
TeamForm.Text2.Locked = True
TeamForm.Image1.Enabled = False
TeamForm.Show
End Sub
Private Sub team_info_Click()
'球队信息
TeamForm.Command1.Enabled = False
TeamForm.Command2.Enabled = False
For i = 0 To 7
TeamForm.Text1(i).Locked = True
Next i
TeamForm.Text2.Locked = True
TeamForm.Image1.Enabled = False
TeamForm.Show
End Sub
Private Sub team_o_Click()
'球队排名
TeamOrder.Show
End Sub
Private Sub team_s_Click()
'球队查询
TeamSearch.Show
End Sub
Private Sub team_st_Click()
MsgBox ("无详细数据,实现同球员统计。")
End Sub
Private Sub teams_o_Click()
MsgBox ("无详细数据,实现同球员统计。")
End Sub
Private Sub text_add_Click()
'文字记录
AdtxtForm.Show
End Sub
Private Sub Timer1_Timer()
Randomize
Image1(num).Visible = False
While newn = num
newn = Fix(Rnd * 8 + 1)
Wend
num = newn
Image1(num).Visible = True
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -