📄 main.frm
字号:
Begin VB.Menu m82
Caption = "记事本"
End
Begin VB.Menu m8Line01
Caption = "-"
End
Begin VB.Menu m83
Caption = "游戏"
Begin VB.Menu m821
Caption = "纸牌"
End
Begin VB.Menu m822
Caption = "扫雷"
End
Begin VB.Menu m823
Caption = "空档接龙"
End
Begin VB.Menu m82Line01
Caption = "-"
End
Begin VB.Menu m824
Caption = "五子棋"
End
Begin VB.Menu m825
Caption = "潜艇大战"
End
Begin VB.Menu m826
Caption = "敲砖块游戏"
End
Begin VB.Menu m827
Caption = "俄罗斯方块"
End
End
Begin VB.Menu m8Line02
Caption = "-"
End
Begin VB.Menu m84
Caption = "关机选项"
End
Begin VB.Menu m85
Caption = "定时提醒"
End
Begin VB.Menu m86
Caption = "控制面板"
End
Begin VB.Menu m8Line03
Caption = "-"
End
Begin VB.Menu m87
Caption = "界面设置"
Begin VB.Menu m861
Caption = "粉红世界"
End
Begin VB.Menu m862
Caption = "绿色阴阴"
End
Begin VB.Menu m86Line01
Caption = "-"
End
Begin VB.Menu m863
Caption = "自定义..."
End
End
Begin VB.Menu m8Line04
Caption = "-"
End
Begin VB.Menu m88
Caption = "帮助"
End
Begin VB.Menu m89
Caption = "关于"
End
End
End
Attribute VB_Name = "frmMain"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'写ini文件
Private a, b, c, d, e, f, g As Long
Dim conn As New ADODb.Connection
Dim rs As New ADODb.Recordset
Dim strSql As String
Private Sub Form_Load()
INIpath = App.Path + "\ini\systemSet.ini"
Me.Left = GetIni("窗口信息", "x坐标", INIpath)
Me.Top = GetIni("窗口信息", "y坐标", INIpath)
Me.Width = GetIni("窗口信息", "宽度", INIpath)
Me.Height = GetIni("窗口信息", "高度", INIpath)
Me.WindowState = GetIni("窗口信息", "状态", INIpath)
Me.Picture = LoadPicture(GetIni("背景图像", "路径", INIpath))
'MsgBox "背景图像已被删除或移走!"
DBpath = App.Path + "\database\school.mdb"
strSql = "provider=Microsoft.Jet.oledb.4.0;data source=" & DBpath & ";Jet OLEDB:Database Password=" & pwd & ";"
conn.Open strSql
strSql = "Select * from 学校资料"
rs.Open strSql, conn, adOpenKeyset, adLockPessimistic
StatusBar1.Panels(1).Alignment = sbrCenter
StatusBar1.Panels(2).Alignment = sbrCenter
StatusBar1.Panels(3).Alignment = sbrCenter
StatusBar1.Panels(4).Alignment = sbrCenter
StatusBar1.Panels(1).Text = rs.Fields("学校名称")
StatusBar1.Panels(2).Text = Now
StatusBar1.Panels(3).Text = "当前操作员:" & UserName
StatusBar1.Panels(4).Text = "用户等级:" & ShenFen & "管理员"
rs.Close
Set rs = Nothing
conn.Close
Set conn = Nothing
End Sub
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
If UnloadMode = vbFormControlMenu Then
If MsgBox("您真的要退出吗?", vbQuestion + vbYesNo + vbDefaultButton2, "提示") = vbNo Then Cancel = True
End If
End Sub
Private Sub Form_Unload(Cancel As Integer)
Left_a$ = Me.Left
Top_b$ = Me.Top
Width_c$ = Me.Width
Height_d$ = Me.Height
State_e$ = Me.WindowState
a = WritePrivateProfileString("窗口信息", "x坐标", Left_a, INIpath)
b = WritePrivateProfileString("窗口信息", "y坐标", Top_b, INIpath)
c = WritePrivateProfileString("窗口信息", "宽度", Width_c, INIpath)
d = WritePrivateProfileString("窗口信息", "高度", Height_d, INIpath)
e = WritePrivateProfileString("窗口信息", "状态", State_e, INIpath)
Unload Me
frmWelcome.Show
End Sub
Private Sub m01_Click()
Unload Me
frmLogin.Show
End Sub
Private Sub m02_Click()
Unload Me
End
End Sub
Private Sub m11_Click()
If ShenFen = "普通" Then
popTiShi = "你的等级不够!"
frmUpDown.Show
Exit Sub
End If
frmXueYuan.Show (1)
End Sub
Private Sub m12_Click()
frmZhiGong.Show (1)
End Sub
Private Sub m54_Click()
frmXueXiao.Show (1)
End Sub
Private Sub m61_Click()
If ShenFen = "普通" Then
popTiShi = "你的等级不够!"
frmUpDown.Show
Exit Sub
End If
frmEditPass.Show (1)
End Sub
Private Sub m62_Click()
If ShenFen = "普通" Then
popTiShi = "你的等级不够!"
frmUpDown.Show
Exit Sub
End If
frmAddUser.Show (1)
End Sub
Private Sub m63_Click()
If ShenFen <> "高级" Then
popTiShi = "你的等级不够!"
frmUpDown.Show
Exit Sub
End If
frmDelUser.Show (1)
End Sub
Private Sub m81_Click()
Shell ("calc.exe"), 1
End Sub
Private Sub m82_Click()
Shell ("notepad.exe"), 1
End Sub
Private Sub m821_Click()
Shell ("sol.exe"), 1
End Sub
Private Sub m822_Click()
Shell ("winmine.exe"), 1
End Sub
Private Sub m823_Click()
Shell ("freecell.exe"), 1
End Sub
Private Sub m824_Click()
End Sub
Private Sub m863_Click()
ShowWin.ShowOpen
ShowWin.Filter = "BMP文件|*.bmp|JPG文件|*.jpg|GIF文件|*.gif|WMF文件|*.wmf|ICO或CUR文件|*.ico,*.cur|所有文件|*.*"
ShowWin.DialogTitle = "★学校管理系统★----开发:张俊强"
IMGpath = ShowWin.InitDir + ShowWin.FileName
Me.Picture = LoadPicture(IMGpath)
f = WritePrivateProfileString("背景图像", "路径", IMGpath, INIpath)
End Sub
Private Sub m88_Click()
frmAbout.Show (1)
End Sub
Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button)
Select Case Button.Key
Case "tbXueYuan"
frmXueYuan.Show (1)
Case "tbZhiGong"
frmZhiGong.Show (1)
Case "tbEditPass"
frmEditPass.Show (1)
Case "tbExit"
If MsgBox("真的要退出吗?", vbYesNo + vbQuestion + vbDefaultButton2, "提示") = vbYes Then
Unload Me
End
End If
Case Else
popTiShi = "本功能尚未开发完成!"
frmUpDown.Show
End Select
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -