?? login.frm
字號:
VERSION 5.00
Begin VB.Form 登錄窗口
Caption = "登錄窗口"
ClientHeight = 3090
ClientLeft = 60
ClientTop = 450
ClientWidth = 4680
LinkTopic = "Form3"
ScaleHeight = 3090
ScaleWidth = 4680
StartUpPosition = 3 '窗口缺省
Begin VB.Frame Frame1
Height = 2895
Left = 53
TabIndex = 0
Top = 98
Width = 4575
Begin VB.TextBox Text2
Height = 375
Left = 1560
TabIndex = 6
Text = "Text2"
Top = 1680
Width = 2055
End
Begin VB.TextBox Text1
Height = 375
Left = 1560
TabIndex = 5
Text = "Text1"
Top = 960
Width = 2055
End
Begin VB.CommandButton Command2
Caption = "取消"
Height = 375
Left = 2520
TabIndex = 2
Top = 2400
Width = 1095
End
Begin VB.CommandButton Command1
Caption = "登錄"
Height = 375
Left = 840
TabIndex = 1
Top = 2400
Width = 975
End
Begin VB.Label Label3
Alignment = 2 'Center
Caption = "用 戶 登 錄"
BeginProperty Font
Name = "黑體"
Size = 15
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 600
TabIndex = 7
Top = 240
Width = 3375
End
Begin VB.Label Label2
Caption = "密碼"
Height = 255
Left = 360
TabIndex = 4
Top = 1800
Width = 1095
End
Begin VB.Label Label1
Caption = "用戶名"
Height = 255
Left = 360
TabIndex = 3
Top = 1080
Width = 1095
End
End
End
Attribute VB_Name = "登錄窗口"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Dim mrc As ADODB.Recordset
txtsql = "select 用戶名,標識 from 用戶 where 用戶名='" & Trim(Text1.Text) & "'"
Set mrc = ExecuteSQL(txtsql)
If mrc.EOF = True Then
MsgBox " 用戶名錯誤!", vbExclamation + vbOKOnly, "警告"
Text1.SetFocus
'Text1.SelStart = 0
'Text1.SelLength = Len(Text1.Text)
Exit Sub
End If
username = mrc.Fields(0)
qxstra = mrc.Fields(1)
mrc.Close
txtsql = "select 密碼 from 用戶 where 密碼='" & Trim(Text2.Text) & "'"
Set mrc = ExecuteSQL(txtsql)
If mrc.EOF = True Then
MsgBox " 密碼錯誤!", vbExclamation + vbOKOnly, "警告"
Text2.SetFocus
'Text2.SelStart = 0
'Text2.SelLength = Len(Text2.Text)
Exit Sub
End If
主窗體.Show
Unload Me
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Load()
Text1.Text = ""
Text2.Text = ""
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text2.SetFocus
End If
End Sub
Private Sub Text2_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Command1.SetFocus
End If
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -