📄 公用.bas
字号:
Attribute VB_Name = "mobPublic"
Option Explicit
'******************************************
'登录窗体设置(denglu.frm)
Sub dengluSet(ThisForm)
If GetKeyValue(HKEY_LOCAL_MACHINE, "software\Company", "CompanySN") = RegSN Then
ThisForm.Caption = "登录--已注册"
Else
ThisForm.Caption = "登录--未注册"
End If
ThisForm.BackColor = BackColorSet
ThisForm.UserName.Caption = "帐号:"
ThisForm.UserName.BackStyle = 0
ThisForm.password.Caption = "密码:"
ThisForm.password.BackStyle = 0
ThisForm.cmdLogin.Caption = "登录"
ThisForm.cmdExit.Caption = "退出"
ThisForm.UserPass.Text = ""
ThisForm.UserPass.PasswordChar = "*"
End Sub
'******************************************
'注册窗体设置(zhuce.frm)
Sub zhuceSet(ThisForm)
ThisForm.Caption = "注册"
'不使用渐变背景时去掉下面注释行
'ThisForm.BackColor = BackColorSet
ThisForm.reguser.ForeColor = vbWhite
ThisForm.reguser.Caption = "用户名:"
ThisForm.reguser.BackStyle = 0
ThisForm.regcode.ForeColor = vbWhite
ThisForm.regcode.Caption = "注册码:"
ThisForm.regcode.BackStyle = 0
ThisForm.cmdTryout.Caption = "试用"
ThisForm.cmdReg.Caption = "注册"
End Sub
'******************************************
'修改密码窗体设置(mima.frm)
Sub mimaSet(ThisForm)
ThisForm.Icon = zhuyao.Icon
ThisForm.Caption = "修改密码"
ThisForm.BackColor = BackColorSet
ThisForm.lblOldPass.Caption = "旧密码:"
ThisForm.lblOldPass.BackStyle = 0
ThisForm.lblNewPass.Caption = "新密码:"
ThisForm.lblNewPass.BackStyle = 0
ThisForm.lblConfirmPass.Caption = "确认新密码:"
ThisForm.lblConfirmPass.BackStyle = 0
ThisForm.cmdOk.Caption = "确定"
ThisForm.cmdCancel.Caption = "取消"
ThisForm.txtOld.PasswordChar = "*"
ThisForm.txtNew.PasswordChar = "*"
ThisForm.txtConfirm.PasswordChar = "*"
End Sub
'******************************************
'主窗体设置(zhuyao.frm)
Sub zhuyaoSet(ThisForm)
ThisForm.Caption = App.Title & "【当前操作员:" & User & "】"
If Level < 3 Then
ThisForm.m07.Visible = False '隐藏设置菜单
End If
End Sub
'******************************************
'员工档案窗体设置(yuangong.frm)
Sub yuangongSet(ThisForm)
ThisForm.Icon = zhuyao.Icon
ThisForm.Caption = "员工档案"
ThisForm.BackColor = BackColorSet
ThisForm.SSTab1.Tab = 0
ThisForm.cmdAdd.Enabled = True
ThisForm.cmdModify.Enabled = False
ThisForm.cmdDel.Enabled = False
ThisForm.cmdSave.Enabled = False
ThisForm.m11.Enabled = True
ThisForm.m12.Enabled = False
ThisForm.m13.Enabled = False
ThisForm.m14.Enabled = False
strCheck = ""
ErrMsg = ""
FoundErr = False
For i = 1 To 39
ThisForm.lblInfo(i).BackStyle = 0
Next i
End Sub
'******************************************
'员工查询窗体设置(yuangongchaxun.frm)
Sub yuangongchaxunSet(ThisForm)
ThisForm.Icon = zhuyao.Icon
ThisForm.Caption = "员工查询"
ThisForm.BackColor = BackColorSet
ThisForm.lblWhereField.BackStyle = 0
ThisForm.lblKeywords.BackStyle = 0
End Sub
'******************************************
'弹出窗体设置(tanchu.frm)
Sub tanchuSet(ThisForm)
ThisForm.BorderStyle = 0
ThisForm.BackColor = BackColorSet
End Sub
'******************************************
'帐号管理窗体设置(zhanghao.frm)
Sub zhanghaoSet(ThisForm)
ThisForm.Icon = zhuyao.Icon
ThisForm.Caption = "帐号管理"
ThisForm.BackColor = BackColorSet
ThisForm.txtModifyUser.Enabled = False
ThisForm.txtModifyPass.Enabled = False
ThisForm.ModifyLevel.Enabled = False
ThisForm.cmdModify.Enabled = False
ThisForm.chkNoLogin.Enabled = False
ThisForm.txtDelUser.Enabled = False
ThisForm.txtDelPass.Enabled = False
ThisForm.cmdDel.Enabled = False
End Sub
'******************************************
'商户档案窗体设置(shanghu.frm)
Sub shanghuSet(ThisForm)
ThisForm.Icon = zhuyao.Icon
ThisForm.Caption = "商户档案"
ThisForm.BackColor = BackColorSet
strCheck = ""
ErrMsg = ""
FoundErr = False
ThisForm.txtShangHu(2).Locked = False
ThisForm.txtHeTong(11).Locked = False
ThisForm.Frame1.BackColor = BackColorSet
ThisForm.Frame2.BackColor = BackColorSet
ThisForm.ShangHuTitle.BackStyle = 0
ThisForm.ShangHuTitle.Alignment = vbCenter
ThisForm.ShangHuTitle.FontSize = 14
ThisForm.lblTitle1.BackStyle = 0
ThisForm.lblTitle2.BackStyle = 0
ThisForm.lblJoinDate.BackStyle = 0
ThisForm.lblModifyDate.BackStyle = 0
ThisForm.lblSumDay.BackStyle = 0
ThisForm.lblLimitDay.BackStyle = 0
ThisForm.lblJoinDate.Visible = False
ThisForm.lblModifyDate.Visible = False
ThisForm.lblSumDay.Visible = False
ThisForm.lblLimitDay.Visible = False
For i = 1 To 10
ThisForm.lblInfo(i).BackStyle = 0
ThisForm.txtShangHu(i).BackColor = BackColorSet
Next i
For j = 11 To 20
ThisForm.lblInfo(j).BackStyle = 0
ThisForm.txtHeTong(j).BackColor = BackColorSet
Next j
For i = 0 To 9
ThisForm.lblHelp(i).BackStyle = 0
ThisForm.lblHelp(i).ForeColor = vbYellow
Next i
End Sub
'******************************************
'计划窗体和计划2窗体(jihua.frm和jihua2.frm)
Sub ShowLblInfo(ThisForm)
Dim r As Integer '记录个数,动态定义数组使用
sql = "select * from [工作计划] where [id]=" & ID
rs.Open sql, conn, 1, 1
r = rs.RecordCount
ReDim d(r) As String
ReDim Important(r) As Boolean
ReDim Finish(r) As Boolean
While Not rs.EOF
d(r) = rs.Fields("plan_date")
Important(r) = rs.Fields("plan_important")
Finish(r) = rs.Fields("plan_finish")
For i = 0 To 36
If ThisForm.TheYear.Text & "-" & ThisForm.TheMonth.ListIndex + 1 & "-" & ThisForm.lblDay(i).Caption = d(r) Then
'下二行设置自定义鼠标样式
ThisForm.lblDay(i).MousePointer = 99
ThisForm.lblDay(i).MouseIcon = LoadPicture(App.Path & "\resource\hand.ico")
If Important(r) = True And Finish(r) = False Then
ThisForm.lblInfo(i).ForeColor = vbRed
ThisForm.lblInfo(i).Caption = "△"
ElseIf Important(r) = True And Finish(r) = True Then
ThisForm.lblInfo(i).ForeColor = vbRed
ThisForm.lblInfo(i).Caption = "▲"
ElseIf Important(r) = False And Finish(r) = False Then
ThisForm.lblInfo(i).ForeColor = vbBlue
ThisForm.lblInfo(i).Caption = "△"
ElseIf Important(r) = False And Finish(r) = True Then
ThisForm.lblInfo(i).ForeColor = vbBlue
ThisForm.lblInfo(i).Caption = "▲"
Else
ThisForm.lblInfo(i).Caption = ""
End If
End If
Next i
rs.MoveNext
Wend
rs.Close
Set rs = Nothing
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -