📄 frm_main.frm
字号:
Width = 11835
_ExtentX = 20876
_ExtentY = 1244
ButtonWidth = 1455
ButtonHeight = 1191
AllowCustomize = 0 'False
Wrappable = 0 'False
Appearance = 1
Style = 1
ImageList = "ImageList1"
_Version = 393216
BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628}
NumButtons = 16
BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "货品入库"
ImageIndex = 1
EndProperty
BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628}
Style = 3
EndProperty
BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "货品出库"
ImageIndex = 2
EndProperty
BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628}
Style = 3
EndProperty
BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628}
Style = 3
EndProperty
BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "库存查询"
ImageIndex = 3
EndProperty
BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628}
Style = 3
EndProperty
BeginProperty Button8 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "信息统计"
ImageIndex = 4
EndProperty
BeginProperty Button9 {66833FEA-8583-11D1-B16A-00C0F0283628}
Style = 3
EndProperty
BeginProperty Button10 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "数据备份"
ImageIndex = 5
EndProperty
BeginProperty Button11 {66833FEA-8583-11D1-B16A-00C0F0283628}
Style = 3
EndProperty
BeginProperty Button12 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "数据恢复"
ImageIndex = 6
EndProperty
BeginProperty Button13 {66833FEA-8583-11D1-B16A-00C0F0283628}
Style = 3
EndProperty
BeginProperty Button14 {66833FEA-8583-11D1-B16A-00C0F0283628}
Style = 3
EndProperty
BeginProperty Button15 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "退出系统"
Key = "exit"
ImageIndex = 7
EndProperty
BeginProperty Button16 {66833FEA-8583-11D1-B16A-00C0F0283628}
Style = 3
EndProperty
EndProperty
BorderStyle = 1
End
Begin VB.Menu QCSZ
Caption = "期初设置"
Begin VB.Menu GYSXXWH
Caption = "供应商信息维护"
End
Begin VB.Menu qq
Caption = "-"
End
Begin VB.Menu CKSZ
Caption = "仓库设置"
End
Begin VB.Menu QCKCSZ
Caption = "期初库存设置"
End
End
Begin VB.Menu HWGL
Caption = "货品管理"
Begin VB.Menu HPRKGL
Caption = "货品入库"
End
Begin VB.Menu HPCKGL
Caption = "货品出库"
End
Begin VB.Menu QW
Caption = "-"
End
Begin VB.Menu HPJC
Caption = "货品借出"
End
Begin VB.Menu HPGH
Caption = "货品归还"
End
Begin VB.Menu WE
Caption = "-"
End
Begin VB.Menu HPPDGL
Caption = "货品盘点"
End
End
Begin VB.Menu CXTJ
Caption = "查询统计"
Begin VB.Menu RKXXCX
Caption = "入库查询"
End
Begin VB.Menu CKXXCX
Caption = "出库查询"
End
Begin VB.Menu KCXXCX
Caption = "库存查询"
End
Begin VB.Menu qr
Caption = "-"
End
Begin VB.Menu HPJCCX
Caption = "货品借出查询"
End
Begin VB.Menu HPGHCX
Caption = "货品归还查询"
End
Begin VB.Menu AA
Caption = "-"
End
Begin VB.Menu CRKXXRTJ
Caption = "出入库货品日统计"
End
Begin VB.Menu CRKNTJ
Caption = "出入库现金年统计"
End
End
Begin VB.Menu SJBB
Caption = "数据报表"
Begin VB.Menu PRINTOUT
Caption = "出库报表"
End
Begin VB.Menu PRINTKC
Caption = "库存报表"
End
End
Begin VB.Menu XTWH
Caption = "系统维护"
Begin VB.Menu CZYXXWH
Caption = "操作员管理"
End
Begin VB.Menu MMXG
Caption = "密码修改"
End
Begin VB.Menu CZYQXSZ
Caption = "操作员权限设置"
End
Begin VB.Menu CC
Caption = "-"
End
Begin VB.Menu SJBF
Caption = "数据备份"
End
Begin VB.Menu SJHF
Caption = "数据恢复"
End
Begin VB.Menu DD
Caption = "-"
End
Begin VB.Menu SJQL
Caption = "数据清理"
End
Begin VB.Menu bb
Caption = "-"
End
Begin VB.Menu CKRZ
Caption = "查看日志"
End
Begin VB.Menu RZQL
Caption = "日志清理"
End
End
Begin VB.Menu TCXT
Caption = "退出系统"
End
End
Attribute VB_Name = "frm_main"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim itmX As ListItem '定义一个ListItem对象
Dim Intext As String '定义一个添加系统登录日志功能的变量
Dim TStr As String
'声明API函数及常量
Private Declare Function GetSystemMenu Lib "user32" (ByVal hwnd As Long, ByVal bRevert As Long) As Long
Private Declare Function RemoveMenu Lib "user32" (ByVal hMenu As Long, ByVal nPosition As Long, ByVal wFlags As Long) As Long
Private Const MF_REMOVE = &H1000&
Private Const SC_MAXIMIZE = &HF030
Private Sub Form_Load()
'利用代码连接数据库
Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\db_kcgl.mdb;Persist Security Info=False"
Adodc2.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\db_kcgl.mdb;Persist Security Info=False"
TreeView1.LabelEdit = tvwManual
Call Tree_change '调用过程,用于显示TreeView控件中的数据信息
ListView1.ListItems.Clear '刷新ListView控件
'向ListView控件中添加元素
Set itmX = ListView1.ListItems.Add(, , "供应商信息", 13)
Set itmX = ListView1.ListItems.Add(, , "仓库设置", 14)
Set itmX = ListView1.ListItems.Add(, , "期初库存设置", 15)
StatusBar1.Panels(2).Text = "当前操作员:MR"
StatusBar1.Panels(3).Text = Format(Date, " yyyy年mm月dd日")
End Sub
'*** 自定义一个过程,用于显示TreeView控件中的数据 ***
Public Sub Tree_change()
Dim key, Text, BH, StrTemp As String
Dim Nod As Node '定义一个节点变量
Adodc1.RecordSource = "select * from tb_zcd "
Adodc1.Refresh
If Adodc1.Recordset.RecordCount > 0 Then
Adodc1.Recordset.MoveFirst
Do While Adodc1.Recordset.EOF = False '循环读取第1层节点中的数据信息
key = Trim(Adodc1.Recordset.Fields("主菜单名称"))
Text = Adodc1.Recordset.Fields("主菜单名称")
StrTemp = Adodc1.Recordset.Fields("主菜单名称")
Set node1 = TreeView1.Nodes.Add(, tvwChild, key, Text, 0) '给第1层节点赋与数值
Adodc2.RecordSource = "select * from tb_zcd_zcd where 主菜单名称='" + StrTemp + "' "
Adodc2.Refresh
If Adodc2.Recordset.RecordCount > 0 Then
Adodc2.Recordset.MoveFirst
Do While Adodc2.Recordset.EOF = False '循环读取第2层节点中的数据信息
key = Trim(Adodc2.Recordset.Fields("子菜单名称"))
Text = Adodc2.Recordset.Fields("子菜单名称")
Set Node2 = TreeView1.Nodes.Add(node1.Index, tvwChild, key, Text, 0) '给第2层节点赋与数值
Adodc2.Recordset.MoveNext
Loop
Else
End If
Adodc1.Recordset.MoveNext
Loop
Else
End If
End Sub
Private Sub TCXT_Click()
End
End Sub
'在窗体的状态栏中显示当前系统的日期时间
Private Sub Timer1_Timer()
StatusBar1.Panels(4).Text = Format(Now, " hh点mm分ss秒")
End Sub
Private Sub Timer2_Timer()
Me.WindowState = 2
Me.WindowState = 0
Timer2.Enabled = False
End Sub
Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button)
Select Case Button.key
Case "exit"
End
End Select
End Sub
'*** 单击TreeView控件中的节点,在ListView控件中显示TreeView节点中相对应的项,并且调用相应的窗体并且判断操作员是否具有相应的权限 ***
Private Sub TreeView1_NodeClick(ByVal Node As MSComctlLib.Node)
If TreeView1.SelectedItem.key = "期初设置" Then
ListView1.ListItems.Clear
Set itmX = ListView1.ListItems.Add(, , "供应商信息", 13)
Set itmX = ListView1.ListItems.Add(, , "仓库设置", 14)
Set itmX = ListView1.ListItems.Add(, , "期初库存设置", 15)
Exit Sub
End If
If TreeView1.SelectedItem.key = "货品管理" Then
ListView1.ListItems.Clear
Set itmX = ListView1.ListItems.Add(, , "货品入库", 3)
Set itmX = ListView1.ListItems.Add(, , "货品出库", 3)
Set itmX = ListView1.ListItems.Add(, , "货品借出", 4)
Set itmX = ListView1.ListItems.Add(, , "货品归还", 4)
Set itmX = ListView1.ListItems.Add(, , "货品盘点", 5)
Exit Sub
End If
If TreeView1.SelectedItem.key = "查询统计" Then
ListView1.ListItems.Clear
Set itmX = ListView1.ListItems.Add(, , "入库查询", 6)
Set itmX = ListView1.ListItems.Add(, , "出库查询", 6)
Set itmX = ListView1.ListItems.Add(, , "库存查询", 6)
Set itmX = ListView1.ListItems.Add(, , "借出查询", 6)
Set itmX = ListView1.ListItems.Add(, , "归还查询", 6)
Set itmX = ListView1.ListItems.Add(, , "日统计", 6)
Set itmX = ListView1.ListItems.Add(, , "出入库年统计", 6)
Exit Sub
End If
If TreeView1.SelectedItem.key = "数据报表" Then
ListView1.ListItems.Clear
Set itmX = ListView1.ListItems.Add(, , "出库报表", 11)
Set itmX = ListView1.ListItems.Add(, , "库存报表", 11)
Exit Sub
End If
If TreeView1.SelectedItem.key = "系统维护" Then
ListView1.ListItems.Clear
Set itmX = ListView1.ListItems.Add(, , "数据备份", 8)
Set itmX = ListView1.ListItems.Add(, , "数据恢复", 9)
Set itmX = ListView1.ListItems.Add(, , "操作员管理", 7)
Set itmX = ListView1.ListItems.Add(, , "密码修改", 4)
Set itmX = ListView1.ListItems.Add(, , "权限设置", 12)
Set itmX = ListView1.ListItems.Add(, , "查看日志", 11)
Set itmX = ListView1.ListItems.Add(, , "数据清理", 10)
Exit Sub
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -