?? frmlogin.frm
字號(hào):
VERSION 5.00
Begin VB.Form frmLogin
BorderStyle = 3 'Fixed Dialog
Caption = "登錄"
ClientHeight = 2550
ClientLeft = 45
ClientTop = 330
ClientWidth = 6075
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2550
ScaleWidth = 6075
ShowInTaskbar = 0 'False
StartUpPosition = 2 '屏幕中心
Tag = "1056"
Begin VB.CommandButton cmdCancel
Cancel = -1 'True
Caption = "取消"
Height = 480
Left = 3090
TabIndex = 5
Tag = "1060"
Top = 1710
Width = 1170
End
Begin VB.CommandButton cmdOK
Caption = "確定"
Default = -1 'True
Height = 480
Left = 1500
TabIndex = 4
Tag = "1059"
Top = 1740
Width = 1170
End
Begin VB.TextBox txtPassword
Height = 420
IMEMode = 3 'DISABLE
Left = 2115
PasswordChar = "*"
TabIndex = 1
Top = 1110
Width = 2535
End
Begin VB.TextBox txtUserName
Height = 420
Left = 2115
TabIndex = 3
Top = 555
Width = 2535
End
Begin VB.Label lblLabels
Caption = "密碼(&P):"
Height = 255
Index = 1
Left = 885
TabIndex = 0
Tag = "1058"
Top = 1200
Width = 1080
End
Begin VB.Label lblLabels
Caption = "用戶名(&U):"
Height = 255
Index = 0
Left = 915
TabIndex = 2
Tag = "1057"
Top = 630
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
LoadResStrings Me
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: 創(chuàng)建測(cè)試密碼是否正確
'檢查正確密碼
'連接數(shù)據(jù)庫
StatDB
If txtPassword.Text = "" Then
OK = True
Me.Hide
Else
MsgBox "密碼錯(cuò)誤,再試一次!", , "登錄"
txtPassword.SetFocus
txtPassword.SelStart = 0
txtPassword.SelLength = Len(txtPassword.Text)
End If
End Sub
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -