📄 frmmain.frm
字号:
VERSION 5.00
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "Comdlg32.ocx"
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Begin VB.MDIForm frmMain
BackColor = &H00808000&
Caption = "宁利标签打印管理系统"
ClientHeight = 5355
ClientLeft = 1170
ClientTop = 1995
ClientWidth = 9045
Icon = "frmMain.frx":0000
LinkTopic = "MDIForm1"
StartUpPosition = 2 '屏幕中心
WindowState = 2 'Maximized
Begin MSComctlLib.Toolbar tbToolBar
Align = 1 'Align Top
Height = 630
Left = 0
TabIndex = 1
Top = 0
Width = 9045
_ExtentX = 15954
_ExtentY = 1111
ButtonWidth = 1455
ButtonHeight = 953
Appearance = 1
ImageList = "imgToolbarIcons"
_Version = 393216
BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628}
NumButtons = 8
BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "退出系统"
Key = "退出系统"
Object.ToolTipText = "退出系统"
ImageIndex = 1
BeginProperty ButtonMenus {66833FEC-8583-11D1-B16A-00C0F0283628}
NumButtonMenus = 1
BeginProperty ButtonMenu1 {66833FEE-8583-11D1-B16A-00C0F0283628}
EndProperty
EndProperty
EndProperty
BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628}
Style = 3
EndProperty
BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "标签打印"
Key = "标签打印"
Object.ToolTipText = "标签打印"
ImageIndex = 4
EndProperty
BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "人员设置"
Key = "人员设置"
Object.ToolTipText = "人员设置"
ImageIndex = 7
EndProperty
BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "权限设置"
Key = "权限设置"
Object.ToolTipText = "权限设置"
ImageIndex = 8
EndProperty
BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "密码更改"
Key = "密码更改"
Object.ToolTipText = "密码更改"
ImageIndex = 9
EndProperty
BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "重新登录"
Key = "重新登录"
Object.ToolTipText = "重新登录"
ImageIndex = 10
EndProperty
BeginProperty Button8 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "系统日志"
Key = "系统日志"
Object.ToolTipText = "系统日志"
ImageIndex = 11
EndProperty
EndProperty
End
Begin MSComctlLib.StatusBar sbStatusBar
Align = 2 'Align Bottom
Height = 270
Left = 0
TabIndex = 0
Top = 5085
Width = 9045
_ExtentX = 15954
_ExtentY = 476
_Version = 393216
BeginProperty Panels {8E3867A5-8586-11D1-B16A-00C0F0283628}
NumPanels = 4
BeginProperty Panel1 {8E3867AB-8586-11D1-B16A-00C0F0283628}
AutoSize = 1
Object.Width = 7408
Text = "*信息窗:"
TextSave = "*信息窗:"
EndProperty
BeginProperty Panel2 {8E3867AB-8586-11D1-B16A-00C0F0283628}
AutoSize = 2
Object.Width = 2884
MinWidth = 2894
Text = "当前用户:"
TextSave = "当前用户:"
EndProperty
BeginProperty Panel3 {8E3867AB-8586-11D1-B16A-00C0F0283628}
Style = 6
AutoSize = 2
Picture = "frmMain.frx":0442
TextSave = "2006-06-01"
EndProperty
BeginProperty Panel4 {8E3867AB-8586-11D1-B16A-00C0F0283628}
Style = 5
AutoSize = 2
Picture = "frmMain.frx":0766
TextSave = "00:36"
EndProperty
EndProperty
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
End
Begin MSComDlg.CommonDialog dlgCommonDialog
Left = 480
Top = 2160
_ExtentX = 847
_ExtentY = 847
_Version = 393216
FontSize = 9
End
Begin MSComctlLib.ImageList imgToolbarIcons
Left = 1260
Top = 2130
_ExtentX = 1005
_ExtentY = 1005
BackColor = -2147483643
ImageWidth = 16
ImageHeight = 16
MaskColor = 12632256
_Version = 393216
BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628}
NumListImages = 12
BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmMain.frx":0A8A
Key = ""
EndProperty
BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmMain.frx":0B96
Key = ""
EndProperty
BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmMain.frx":0EEA
Key = ""
EndProperty
BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmMain.frx":123E
Key = ""
EndProperty
BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmMain.frx":1592
Key = ""
EndProperty
BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmMain.frx":18E6
Key = ""
EndProperty
BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmMain.frx":1C3A
Key = ""
EndProperty
BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmMain.frx":1F8E
Key = ""
EndProperty
BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmMain.frx":22E2
Key = ""
EndProperty
BeginProperty ListImage10 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmMain.frx":2636
Key = ""
EndProperty
BeginProperty ListImage11 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmMain.frx":298A
Key = ""
EndProperty
BeginProperty ListImage12 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmMain.frx":2CDE
Key = ""
EndProperty
EndProperty
End
Begin VB.Menu mnubqdy
Caption = "标签管理"
Begin VB.Menu mnuabgl
Caption = "安标管理"
End
Begin VB.Menu mnuddsj
Caption = "生产任务管理"
End
Begin VB.Menu mnupn
Caption = "PN表管理"
End
Begin VB.Menu mnuhb
Caption = "环标数据管理"
End
Begin VB.Menu mnubqsl
Caption = "标签数量管理"
End
Begin VB.Menu mnuabfw
Caption = "安标范围管理"
End
Begin VB.Menu mnubqprint
Caption = "标签打印"
End
Begin VB.Menu mnnbar0
Caption = "-"
End
Begin VB.Menu mnuexit
Caption = "退出系统"
End
End
Begin VB.Menu mnuSystemSet
Caption = "系统设置(&S)"
Begin VB.Menu mnuprint
Caption = "打印机纸张类型"
End
Begin VB.Menu mnut
Caption = "-"
End
Begin VB.Menu mnuPeopSet
Caption = "人员设置"
End
Begin VB.Menu mnuSystemBar2
Caption = "-"
End
Begin VB.Menu mnuPurviewSet
Caption = "权限设置"
End
Begin VB.Menu mnuSystemBar3
Caption = "-"
End
Begin VB.Menu mnuPswdChg
Caption = "密码更改"
End
End
Begin VB.Menu mnuProtect
Caption = "系统维护(&P)"
Begin VB.Menu mnuRelogin
Caption = "重新登录"
End
Begin VB.Menu mnuProtectBar1
Caption = "-"
End
Begin VB.Menu mnuBackup
Caption = "数据备份"
Begin VB.Menu mnuAutoBackup
Caption = "定时备份"
End
Begin VB.Menu mnuManuBackup
Caption = "手工备份"
End
End
Begin VB.Menu mnuRestore
Caption = "数据恢复"
End
Begin VB.Menu mnuProtectBar2
Caption = "-"
End
Begin VB.Menu mnuViewToolBar
Caption = "工具栏"
End
Begin VB.Menu mnuViewStatusBar
Caption = "状态栏"
End
End
Begin VB.Menu mnuHelp
Caption = "帮助(&H)"
Begin VB.Menu mnuHelpTopic
Caption = "帮助主题"
End
Begin VB.Menu mnuHelpBar1
Caption = "-"
End
Begin VB.Menu mnuSystemlog
Caption = "系统日志"
End
Begin VB.Menu mnuHelpAbout
Caption = "关于(&A) "
End
End
End
Attribute VB_Name = "frmMain"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Declare Function OSWinHelp% Lib "user32" Alias "WinHelpA" (ByVal hwnd&, ByVal HelpFile$, ByVal wCommand%, dwData As Any)
''Private Declare Function WinExec Lib "kernel32" (ByVal lpCmdLine As String, ByVal nCmdShow As Long) As Long '这方法也可以
''Const EM_UNDO = &HC7
Private Declare Function GetSystemDirectory Lib "kernel32" Alias "GetSystemDirectoryA" (ByVal lpBuffer As String, ByVal nSize As Long) As Long
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Private Declare Function GetDesktopWindow Lib "user32" () As Long
Dim rsMain, rsTmp As ADODB.Recordset '用于主窗口
Private Sub MDIForm_Load()
Dim ExistFile As String
'Dim fso As New FileSystemObject
Dim i As Integer
Me.Left = GetSetting(App.Title, "Settings", "MainLeft", 1000)
Me.Top = GetSetting(App.Title, "Settings", "MainTop", 1000)
Me.Width = GetSetting(App.Title, "Settings", "MainWidth", 6500)
Me.Height = GetSetting(App.Title, "Settings", "MainHeight", 6500)
mnuViewToolBar.Checked = True '设置初始值
mnuViewStatusBar.Checked = True
tbToolBar.Visible = mnuViewToolBar.Checked
sbStatusBar.Visible = mnuViewStatusBar.Checked
sbStatusBar.Panels(2).Text = "当前用户: " + UserName
'ExistFile = Dir(SystemDir + "\Data\Manufact.mdb") '若文件被破坏,则先恢复
'If ExistFile = "" Then
' fso.CopyFile SystemDir + "\Data\Manufactbak.mdb", SystemDir + "\Data\Manufact.mdb", True '数据文件
'End If
'将模块权限与菜单、按钮相结合
'*例 mnuViewToolbar.Enabled = False tbToolBar.Buttons(1).Enabled = False
Set rsTmp = New ADODB.Recordset '先利用 rsTmp 获得有关系数
rsTmp.CursorType = adOpenKeyset
rsTmp.LockType = adLockOptimistic
rsTmp.Open "Select * From 用户权限", cnSys
rsTmp.Find "用户帐号='" & UserName & "'"
If IsNull(rsTmp("使用模块")) Or IsEmpty(rsTmp("使用模块")) Then
PurvString = "111111111111111" '缺省值为拥有所有模块
Else
PurvString = Trim(rsTmp("使用模块"))
End If
rsTmp.Close
For i = 1 To Len(PurvString)
If Mid(PurvString, i, 1) = "1" Then
Call MenuButtSet(i, True)
Else
Call MenuButtSet(i, False)
End If
Next i
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -