📄 frmlogin.frm
字号:
VERSION 5.00
Begin VB.Form frmLogin
BackColor = &H00400000&
BorderStyle = 3 'Fixed Dialog
Caption = "Login"
ClientHeight = 3045
ClientLeft = 30
ClientTop = 330
ClientWidth = 4950
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3045
ScaleWidth = 4950
ShowInTaskbar = 0 'False
StartUpPosition = 2 '屏幕中心
Tag = "Login"
Begin VB.CommandButton cmdCancel
Cancel = -1 'True
Caption = "Cancel"
Height = 360
Left = 2880
TabIndex = 5
Tag = "Cancel"
Top = 2400
Width = 1140
End
Begin VB.CommandButton cmdOK
Caption = "OK"
Default = -1 'True
Height = 360
Left = 840
TabIndex = 4
Tag = "OK"
Top = 2400
Width = 1140
End
Begin VB.TextBox txtPassword
Height = 285
IMEMode = 3 'DISABLE
Left = 1920
PasswordChar = "*"
TabIndex = 1
Top = 1920
Width = 2325
End
Begin VB.TextBox txtUserName
Height = 285
Left = 1920
TabIndex = 3
Top = 1440
Width = 2325
End
Begin VB.Label lblLabels
BackColor = &H00400000&
Caption = "制作人:任轶杰 杜娜娜"
BeginProperty Font
Name = "News Gothic MT"
Size = 10.5
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FFFFFF&
Height = 255
Index = 2
Left = 1200
TabIndex = 7
Tag = "&User Name:"
Top = 960
Width = 2640
End
Begin VB.Label Label1
BackColor = &H00400000&
Caption = "图书馆管理系统"
BeginProperty Font
Name = "华文彩云"
Size = 24
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FFFFFF&
Height = 615
Left = 720
TabIndex = 6
Top = 120
Width = 3735
End
Begin VB.Label lblLabels
BackColor = &H00400000&
Caption = "密 码:"
BeginProperty Font
Name = "News Gothic MT"
Size = 10.5
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FFFFFF&
Height = 255
Index = 1
Left = 720
TabIndex = 0
Tag = "&Password:"
Top = 1920
Width = 840
End
Begin VB.Label lblLabels
BackColor = &H00400000&
Caption = "用户名:"
BeginProperty Font
Name = "News Gothic MT"
Size = 10.5
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FFFFFF&
Height = 255
Index = 0
Left = 720
TabIndex = 2
Tag = "&User Name:"
Top = 1440
Width = 1080
End
End
Attribute VB_Name = "frmLogin"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Declare Function GetUserName Lib "advapi32.dll" Alias "GetUserNameA" (ByVal lpbuffer As String, nSize As Long) As Long
Public OK As Boolean
Private Sub Form_Load()
Dim sBuffer As String
Dim lSize As Long
sBuffer = Space$(255)
lSize = Len(sBuffer)
Call GetUserName(sBuffer, lSize)
If lSize > 0 Then
txtUserName.Text = Left$(sBuffer, lSize)
Else
txtUserName.Text = vbNullString
End If
End Sub
Private Sub CmdCancel_Click()
OK = False
Me.Hide
End Sub
Private Sub cmdOK_Click()
'ToDo: create test for correct password
'check for correct password
If txtPassword.Text = "rd" Then
OK = True
Me.Hide
Else
MsgBox "密码错误,请重试!", , "Login"
txtPassword.SetFocus
txtPassword.SelStart = 0
txtPassword.SelLength = Len(txtPassword.Text)
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -