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

📄 loginform.ctl

📁 实现了
💻 CTL
字号:
VERSION 5.00
Begin VB.UserControl loginl1 
   ClientHeight    =   4155
   ClientLeft      =   0
   ClientTop       =   0
   ClientWidth     =   6750
   ScaleHeight     =   4155
   ScaleWidth      =   6750
   Begin VB.CommandButton cmdexit 
      Caption         =   "exit"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   14.25
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   3720
      TabIndex        =   5
      Top             =   2760
      Width           =   1335
   End
   Begin VB.CommandButton CmdLogin 
      Caption         =   "Login"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   14.25
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   1920
      TabIndex        =   4
      Top             =   2760
      Width           =   1455
   End
   Begin VB.TextBox txtpassword 
      Height          =   495
      IMEMode         =   3  'DISABLE
      Left            =   3000
      PasswordChar    =   "*"
      TabIndex        =   3
      Top             =   1440
      Width           =   3015
   End
   Begin VB.TextBox txtloginID 
      Height          =   495
      Left            =   3000
      TabIndex        =   0
      Top             =   600
      Width           =   3015
   End
   Begin VB.Label LblPwd 
      Caption         =   "Password:"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   14.25
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   600
      TabIndex        =   2
      Top             =   1440
      Width           =   1695
   End
   Begin VB.Label LblCustomerid 
      Caption         =   "Customer ID:"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   14.25
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   600
      TabIndex        =   1
      Top             =   600
      Width           =   1815
   End
End
Attribute VB_Name = "loginl1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Dim sql As String
Dim mvarcust As Boolean
Dim ad As ADODB.Recordset


Private Sub cmdexit_Click()
Unload frmlogin
Unload MenuFrm
End Sub



' Property to return the password
Private Sub CmdLogin_Click()
Call check
End Sub

 
'load Property values from storage
Private Sub UserControl_readProperties(Propbag As PropertyBag)
txtloginID.Text = Propbag.ReadProperty("LoginID", "")
txtpassword.Text = Propbag.ReadProperty("Password.text", "")
End Sub
'write Property values to storage
Private Sub UserControl_writeproperties(Propbag As PropertyBag)
Call Propbag.WriteProperty("LoginID", txtloginID.Text, "")
Call Propbag.WriteProperty("Password", txtpassword.Text, "")
End Sub
Private Property Get Password() As String
Password = Trim(txtpassword.Text)
End Property
Private Property Get LoginID() As String
LoginID = Trim(txtloginID.Text)
End Property
Public Function check()
On Error Resume Next
Getconnected
sql = "select * from customers where cust_id='" & LoginID & "'and cust_password='" & Password & "'"
If executesql(sql) = True Then
    MDIMenuform.Visible = True
    Unload frmlogin
Else
    txtpassword.Text = ""
    txtloginID.Text = ""
    MsgBox "您输入的记录不正确!请重新输入!"
    End If
    disconnect
End Function





⌨️ 快捷键说明

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