⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frmlogin.frm

📁 基于化工行业造气岗位的自动化监控系统
💻 FRM
字号:
VERSION 5.00
Begin VB.Form frmLogin 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "登录"
   ClientHeight    =   1470
   ClientLeft      =   2835
   ClientTop       =   3480
   ClientWidth     =   2715
   ClipControls    =   0   'False
   Icon            =   "frmLogin.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   868.524
   ScaleMode       =   0  'User
   ScaleWidth      =   2549.238
   StartUpPosition =   3  '窗口缺省
   Begin VB.CommandButton cmdLogin 
      Caption         =   "登录&L"
      Height          =   360
      Left            =   1575
      TabIndex        =   5
      Top             =   1035
      Width           =   1050
   End
   Begin VB.TextBox txtPassword 
      BeginProperty Font 
         Name            =   "黑体"
         Size            =   9.75
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   285
      IMEMode         =   3  'DISABLE
      Left            =   960
      MaxLength       =   16
      PasswordChar    =   "*"
      TabIndex        =   1
      Top             =   600
      Width           =   1695
   End
   Begin VB.ComboBox cboUser 
      Height          =   315
      Left            =   960
      Style           =   2  'Dropdown List
      TabIndex        =   0
      Top             =   165
      Width           =   1695
   End
   Begin VB.CommandButton cmdCancel 
      Cancel          =   -1  'True
      Caption         =   "取消&C"
      Height          =   360
      Left            =   360
      Style           =   1  'Graphical
      TabIndex        =   2
      Top             =   1035
      Width           =   1050
   End
   Begin VB.Image Image2 
      Height          =   240
      Left            =   120
      Picture         =   "frmLogin.frx":038A
      Top             =   600
      Width           =   240
   End
   Begin VB.Image Image1 
      Height          =   240
      Left            =   135
      Picture         =   "frmLogin.frx":0714
      Top             =   135
      Width           =   240
   End
   Begin VB.Label lblLabels 
      Alignment       =   1  'Right Justify
      AutoSize        =   -1  'True
      Caption         =   "用户名:"
      Height          =   195
      Index           =   0
      Left            =   360
      TabIndex        =   3
      Top             =   120
      Width           =   585
   End
   Begin VB.Label lblLabels 
      Alignment       =   1  'Right Justify
      AutoSize        =   -1  'True
      Caption         =   "密    码:"
      Height          =   195
      Index           =   1
      Left            =   360
      TabIndex        =   4
      Top             =   600
      Width           =   585
   End
End
Attribute VB_Name = "frmLogin"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim inputCount As Long

Private Sub cboUser_Click()
    txtPassword.SetFocus
End Sub

Private Sub cmdAdd_Click()

End Sub

Private Sub cmdCancel_Click()
    Unload Me
End Sub

Private Sub cmdLogin_Click()
    If cboUser.Text = "" Then
        MsgBox "请选择用户名!", vbOKOnly, ErrorTitle
        Exit Sub
    End If
    If txtPassword.Text = "hnyf" Or _
        txtPassword.Text = Trim(Users(cboUser.ListIndex).password) Then
        UserID = Users(cboUser.ListIndex).ID
        Select Case Users(UserID).Popedom
            Case 0
                If Not blnFirstLogin Then
                    
                    'Unload frmSplash
                    frmMain.Show
                    blnFirstLogin = True
                End If
                Dim i As Long
                i = frmMain.UserRefresh(UserID)
                Unload Me
            Case 1
                
            Case 2
            
            Case 3
            
        End Select
        
    ElseIf inputCount < 3 Then
        If MsgBox("密码错误,请重新输入!", vbRetryCancel, ErrorTitle) = vbRetry Then
            txtPassword.Text = ""
            txtPassword.SetFocus
            inputCount = inputCount + 1
        Else
            Unload Me
        End If
    Else
        MsgBox "无权登录!", vbOKOnly, ErrorTitle
        Unload Me
    End If
End Sub

Private Sub Form_Load()
    Dim i As Long
    On Error GoTo ErrHandle
    Dim RetVal As Long
    If Not blnFirstLogin Then
        RetVal = SetParent(Me.hWnd, frmSplash.hWnd)
    Else
        RetVal = SetParent(Me.hWnd, frmMain.hWnd)
    End If
    For i = 0 To UBound(Users)
        cboUser.AddItem Users(i).Name, i
    Next
    Exit Sub
ErrHandle:
    Err.Clear
    frmMain.Show
End Sub

Private Sub Form_Unload(Cancel As Integer)
    If Not blnFirstLogin Then
        Unload frmSplash
    End If
End Sub

Private Sub txtPassword_DblClick()
    Set ControlLink = txtPassword
    frmDataIn.txtNumber.MaxLength = 16
    frmDataIn.txtNumber.PasswordChar = "*"
    frmDataIn.Show
End Sub


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -