frmMain.frm
上传用户:xianglong
上传日期:2022-06-19
资源大小:1105k
文件大小:15k
- VERSION 5.00
- Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomctl.ocx"
- Begin VB.Form frmMain
- BackColor = &H8000000C&
- Caption = "自动配料系统"
- ClientHeight = 5940
- ClientLeft = 3690
- ClientTop = 3030
- ClientWidth = 8595
- LinkTopic = "Form1"
- ScaleHeight = 5940
- ScaleWidth = 8595
- WindowState = 2 'Maximized
- Begin VB.Data d1
- Caption = "Data1"
- Connect = "Access"
- DatabaseName = ""
- DefaultCursorType= 0 '缺省游标
- DefaultType = 2 '使用 ODBC
- Exclusive = 0 'False
- Height = 372
- Left = 3480
- Options = 0
- ReadOnly = 0 'False
- RecordsetType = 1 'Dynaset
- RecordSource = ""
- Top = 3120
- Visible = 0 'False
- Width = 1692
- End
- Begin VB.Timer Timer1
- Interval = 1000
- Left = 2160
- Top = 2040
- End
- Begin MSComctlLib.ImageList ImList
- Left = 960
- Top = 2640
- _ExtentX = 1005
- _ExtentY = 1005
- BackColor = -2147483643
- ImageWidth = 16
- ImageHeight = 16
- MaskColor = 12632256
- _Version = 393216
- BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628}
- NumListImages = 10
- BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmMain.frx":0000
- Key = "batch"
- EndProperty
- BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmMain.frx":08DA
- Key = "analysis"
- EndProperty
- BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmMain.frx":11B4
- Key = "user"
- EndProperty
- BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmMain.frx":1A8E
- Key = "about"
- EndProperty
- BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmMain.frx":2368
- Key = "exit"
- EndProperty
- BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmMain.frx":2C42
- Key = "view"
- EndProperty
- BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmMain.frx":351C
- Key = "db"
- EndProperty
- BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmMain.frx":3DF6
- Key = "system"
- EndProperty
- BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmMain.frx":46D0
- Key = "permission"
- EndProperty
- BeginProperty ListImage10 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmMain.frx":6B82
- Key = "help"
- EndProperty
- EndProperty
- End
- Begin MSComctlLib.StatusBar sbrDB
- Align = 2 'Align Bottom
- Height = 510
- Left = 0
- TabIndex = 0
- Top = 5430
- Width = 8595
- _ExtentX = 15161
- _ExtentY = 900
- _Version = 393216
- BeginProperty Panels {8E3867A5-8586-11D1-B16A-00C0F0283628}
- NumPanels = 4
- BeginProperty Panel1 {8E3867AB-8586-11D1-B16A-00C0F0283628}
- AutoSize = 1
- Object.Width = 2646
- Picture = "frmMain.frx":81DC
- EndProperty
- BeginProperty Panel2 {8E3867AB-8586-11D1-B16A-00C0F0283628}
- Style = 6
- AutoSize = 2
- Object.Width = 2884
- MinWidth = 2892
- Picture = "frmMain.frx":8AB6
- TextSave = "2007-6-3"
- EndProperty
- BeginProperty Panel3 {8E3867AB-8586-11D1-B16A-00C0F0283628}
- Style = 5
- AutoSize = 2
- Object.Width = 3201
- MinWidth = 1252
- TextSave = "☆崔兆阳☆ 10:01"
- EndProperty
- BeginProperty Panel4 {8E3867AB-8586-11D1-B16A-00C0F0283628}
- Object.Width = 5821
- MinWidth = 5821
- Picture = "frmMain.frx":8F08
- Text = "版权:崔兆阳(czy) 03201233"
- TextSave = "版权:崔兆阳(czy) 03201233"
- EndProperty
- EndProperty
- BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
- Name = "宋体"
- Size = 9.75
- Charset = 134
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- End
- Begin MSComctlLib.Toolbar Tlbar
- Align = 1 'Align Top
- Height = 570
- Left = 0
- TabIndex = 1
- Top = 0
- Width = 8595
- _ExtentX = 15161
- _ExtentY = 1005
- ButtonWidth = 1138
- ButtonHeight = 953
- Appearance = 1
- Style = 1
- ImageList = "ImList"
- _Version = 393216
- BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628}
- NumButtons = 19
- BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "物料"
- Key = "batch"
- ImageIndex = 1
- EndProperty
- BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Style = 3
- EndProperty
- BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "分析"
- Key = "analysis"
- ImageIndex = 2
- EndProperty
- BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Style = 3
- EndProperty
- BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "用户"
- Key = "user"
- ImageIndex = 3
- EndProperty
- BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Style = 3
- EndProperty
- BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "数据库"
- Key = "db"
- ImageIndex = 7
- EndProperty
- BeginProperty Button8 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Style = 3
- EndProperty
- BeginProperty Button9 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "辅助"
- Key = "system"
- ImageIndex = 8
- Style = 5
- BeginProperty ButtonMenus {66833FEC-8583-11D1-B16A-00C0F0283628}
- NumButtonMenus = 4
- BeginProperty ButtonMenu1 {66833FEE-8583-11D1-B16A-00C0F0283628}
- Key = "tbndraw"
- Text = "调用画图程序"
- EndProperty
- BeginProperty ButtonMenu2 {66833FEE-8583-11D1-B16A-00C0F0283628}
- Key = "tbntxt"
- Text = "调用记事本程序"
- EndProperty
- BeginProperty ButtonMenu3 {66833FEE-8583-11D1-B16A-00C0F0283628}
- Key = "tbncounter"
- Text = "调用计算器程序"
- EndProperty
- BeginProperty ButtonMenu4 {66833FEE-8583-11D1-B16A-00C0F0283628}
- Key = "tbnoutlook"
- Text = "调用OutLook"
- EndProperty
- EndProperty
- EndProperty
- BeginProperty Button10 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Style = 3
- EndProperty
- BeginProperty Button11 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "关于"
- Key = "about"
- ImageIndex = 4
- EndProperty
- BeginProperty Button12 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Style = 3
- EndProperty
- BeginProperty Button13 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "模拟"
- Key = "view"
- ImageIndex = 6
- EndProperty
- BeginProperty Button14 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Style = 3
- EndProperty
- BeginProperty Button15 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "权限"
- Key = "permission"
- ImageIndex = 9
- EndProperty
- BeginProperty Button16 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Style = 3
- EndProperty
- BeginProperty Button17 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "帮助"
- Key = "help"
- ImageIndex = 10
- EndProperty
- BeginProperty Button18 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Style = 3
- EndProperty
- BeginProperty Button19 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "退出"
- Key = "exit"
- ImageIndex = 5
- EndProperty
- EndProperty
- End
- End
- Attribute VB_Name = "frmMain"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Public dbs As Database
- Public filename As String
- 'Dim MyVar
- Private Sub Form_Unload(Cancel As Integer)
- End
- End Sub
- Private Sub Form_Load()
- sbrDB.Panels(1).Text = "User:" & Trim(czy)
- sbrDB.Panels(2).Text = frmLogin.txtDate.Text
- App.HelpFile = App.Path & "Batching.CHM"
- End Sub
-
- Private Sub CmdHelp_Click()
- Shell "hh.exe Batching.CHM", vbNormalFocus
- SendKeys "{F1}"
- End Sub
-
- Private Sub a_Click()
- filename = App.Path & "dbmaterialinfo2007.mdb"
- Set dbs = OpenDatabase(filename)
- Set rec = dbs.OpenRecordset("用户角色表")
- D1.DatabaseName = filename
- D1.RecordSource = "select * from 用户角色表 where name='" + sbrDB.Panels(1).Text + "'"
- D1.Refresh
- If D1.Recordset.Fields(0) = -1 Then
- frmMaterial.Show
- 'a.Enabled = True
-
- ElseIf D1.Recordset.Fields(0) = 0 Then
- MsgBox "<@>请选择其他功能,您的权限级别不够<@>"
- End If
- 'frmMaterial.Show
- End Sub
- Private Sub b_Click()
- filename = App.Path & "dbmaterialinfo2007.mdb"
- Set dbs = OpenDatabase(filename)
- Set rec = dbs.OpenRecordset("用户角色表")
- D1.DatabaseName = filename
- D1.RecordSource = "select * from 用户角色表 where name='" + sbrDB.Panels(1).Text + "'"
- D1.Refresh
- If D1.Recordset.Fields(1) = -1 Then
- 'b.Enabled = True
- frmAnalysis.Show
- ElseIf D1.Recordset.Fields(1) = 0 Then
- MsgBox "<@>请选择其他功能,您的权限级别不够<@>"
- End If
- 'frmAnalysis.Show
- End Sub
- Private Sub c_Click()
- filename = App.Path & "dbmaterialinfo2007.mdb"
- Set dbs = OpenDatabase(filename)
- Set rec = dbs.OpenRecordset("用户角色表")
- D1.DatabaseName = filename
- D1.RecordSource = "select * from 用户角色表 where name='" + sbrDB.Panels(1).Text + "'"
- D1.Refresh
- If D1.Recordset.Fields(2) = -1 Then
- 'c.Enabled = True
- frmUser.Show
- ElseIf D1.Recordset.Fields(2) = 0 Then
- MsgBox "<@>请选择其他功能,您的权限级别不够<@>"
- End If
- 'frmUser.Show
- End Sub
- Private Sub d_Click()
- filename = App.Path & "dbmaterialinfo2007.mdb"
- Set dbs = OpenDatabase(filename)
- Set rec = dbs.OpenRecordset("用户角色表")
- D1.DatabaseName = filename
- D1.RecordSource = "select * from 用户角色表 where name='" + sbrDB.Panels(1).Text + "'"
- D1.Refresh
- If D1.Recordset.Fields(3) = -1 Then
- 'd.Enabled = True
- frmPermission.Show
- ElseIf D1.Recordset.Fields(3) = 0 Then
- MsgBox "<@>请选择其他功能,您的权限级别不够<@>"
- End If
- 'frmPermission.Show
- End Sub
- Private Sub e_Click()
- filename = App.Path & "dbmaterialinfo2007.mdb"
- Set dbs = OpenDatabase(filename)
- Set rec = dbs.OpenRecordset("用户角色表")
- D1.DatabaseName = filename
- D1.RecordSource = "select * from 用户角色表 where name='" + sbrDB.Panels(1).Text + "'"
- D1.Refresh
- 'frmDb.Show
- If D1.Recordset.Fields(4) = -1 Then
- 'e.Enabled = True
- frmDb.Show
- ElseIf D1.Recordset.Fields(4) = 0 Then
- MsgBox "<@>请选择其他功能,您的权限级别不够<@>"
- End If
- 'frmDb.Show
- End Sub
- Private Sub Timer1_Timer()
- sbrDB.Panels(3).Text = Time
- End Sub
- Private Sub Tlbar_ButtonClick(ByVal Button As MSComctlLib.Button)
- Select Case Button.key
- Case "batch"
-
- a_Click
- 'frmMaterial.Show
- Case "analysis"
- b_Click
- 'frmAnalysis.Show
- Case "user"
- c_Click
- 'frmUser.Show
- Case "db"
- e_Click
- 'frmDb.Show
- Case "about"
- frmAbout.Show
- Case "view"
- frmView.Show
- Case "permission"
- d_Click
- 'frmPermission.Show
- Case "help"
- CmdHelp_Click
- Case "exit"
- Dim strmsg As String
- strmsg = "您确定退出吗?"
- If MsgBox(strmsg, vbQuestion + vbOKCancel + vbDefaultButton1, "自动配料系统") = vbOK Then
- Cancel = False
- End
- Else
- Cancel = True
- End If
- End Select
- End Sub
- Private Sub Tlbar_ButtonMenuClick(ByVal ButtonMenu As MSComctlLib.ButtonMenu)
- Select Case ButtonMenu.key
- Case "tbndraw"
- ShellExecute Me.hwnd, "open", "mspaint.exe", "", 1, 5
- Case "tbntxt"
- ShellExecute Me.hwnd, "open", "notepad.exe", "", 1, 5
- Case "tbncounter"
- Shell "calc.exe"
- Case "tbnoutlook"
- ShellExecute Me.hwnd, "open", "outlook.exe", "", 1, 5
- End Select
- End Sub