📄 frmlogin.frm
字号:
VERSION 5.00
Begin VB.Form frmLogin
BorderStyle = 3 'Fixed Dialog
Caption = "登 录"
ClientHeight = 3810
ClientLeft = 30
ClientTop = 330
ClientWidth = 5760
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3810
ScaleWidth = 5760
ShowInTaskbar = 0 'False
StartUpPosition = 2 '屏幕中心
Tag = "Login"
Begin VB.Frame Frame1
Height = 1215
Left = 480
TabIndex = 1
Top = 1320
Width = 4695
Begin VB.TextBox txtUserName
Height = 288
Left = 1800
TabIndex = 4
Top = 360
Width = 2064
End
Begin VB.TextBox txtPassword
Height = 288
IMEMode = 3 'DISABLE
Left = 1800
PasswordChar = "*"
TabIndex = 5
Top = 720
Width = 2064
End
Begin VB.Label lblLabels
Caption = "密 码:"
BeginProperty Font
Name = "华文新魏"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Index = 0
Left = 720
TabIndex = 3
Tag = "&Password:"
Top = 720
Width = 1080
End
Begin VB.Label lblLabels
Caption = "用户名:"
BeginProperty Font
Name = "华文新魏"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Index = 2
Left = 600
TabIndex = 2
Tag = "&User Name:"
Top = 360
Width = 1080
End
End
Begin VB.CommandButton cmdCancel
Cancel = -1 'True
Caption = "取 消"
Height = 360
Left = 3480
TabIndex = 7
Tag = "Cancel"
Top = 3240
Width = 1140
End
Begin VB.CommandButton cmdOK
Caption = "确 定"
Default = -1 'True
Height = 360
Left = 960
TabIndex = 6
Tag = "OK"
Top = 3240
Width = 1140
End
Begin VB.Line Line2
X1 = 0
X2 = 6120
Y1 = 2880
Y2 = 2880
End
Begin VB.Line Line1
BorderColor = &H80000009&
BorderWidth = 3
X1 = 0
X2 = 6120
Y1 = 2880
Y2 = 2880
End
Begin VB.Label Label1
Caption = "医药公司进销存系统"
BeginProperty Font
Name = "华文新魏"
Size = 21.75
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00C00000&
Height = 495
Left = 720
TabIndex = 0
Top = 480
Width = 4455
End
End
Attribute VB_Name = "frmLogin"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public OK As Boolean
Dim rs As ADODB.Recordset
Dim sql As String
Dim msgtxt As String
Private Sub cmdOK_Click()
UserName = ""
If Trim(txtUserName.Text = "") Then
MsgBox "没有这个用户,请重新输入用户名!", vbOKOnly + vbExclamation, "警告"
txtUserName.SetFocus
Else
sql = "select * from userpwd where U_name = " & "'" & txtUserName.Text & "'"
Set rs = ExecuteSQL(sql, msgtxt)
If rs.EOF = True Then
MsgBox "没有这个用户,请重新输入用户名!", vbOKOnly + vbExclamation, "警告"
txtUserName.SetFocus
Else
If Trim(rs.Fields(1)) = Trim(txtPassword.Text) Then
OK = True
UserName = Trim(txtUserName.Text)
UserPass = Trim(txtPassword.Text)
rs.Close
Me.Hide
Else
MsgBox "输入密码不正确,请重新输入!", vbOKOnly + vbExclamation, "警告"
txtPassword.SetFocus
txtPassword.Text = ""
End If
End If
End If
End Sub
Private Sub cmdCancel_Click()
OK = False
Me.Hide
End
End Sub
Private Sub Form_Activate()
txtUserName.SetFocus
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -