📄 zcxyh .frm
字号:
VERSION 5.00
Object = "{FAEEE763-117E-101B-8933-08002B2F4F5A}#1.1#0"; "DBLIST32.OCX"
Begin VB.Form zcxyh
Caption = "Form1"
ClientHeight = 2100
ClientLeft = 60
ClientTop = 345
ClientWidth = 5055
LinkTopic = "Form1"
ScaleHeight = 2100
ScaleWidth = 5055
StartUpPosition = 3 '窗口缺省
Begin VB.TextBox Text3
Height = 270
Left = 2880
MaxLength = 8
TabIndex = 7
Top = 1440
Width = 1815
End
Begin VB.TextBox Text2
Height = 270
Left = 2880
MaxLength = 8
TabIndex = 6
Top = 840
Width = 1815
End
Begin VB.TextBox Text1
Height = 270
Left = 2880
MaxLength = 8
TabIndex = 3
Top = 360
Width = 1815
End
Begin MSDBCtls.DBList DBList1
Bindings = "zcxyh.frx":0000
DataSource = "Data1"
Height = 1530
Left = 120
TabIndex = 1
Top = 360
Width = 1215
_ExtentX = 2143
_ExtentY = 2699
_Version = 393216
ListField = "username"
End
Begin VB.Data Data1
Caption = "Data1"
Connect = "Access"
DatabaseName = ""
DefaultCursorType= 0 '缺省游标
DefaultType = 2 '使用 ODBC
Exclusive = 0 'False
Height = 345
Left = 1800
Options = 0
ReadOnly = 0 'False
RecordsetType = 1 'Dynaset
RecordSource = ""
Top = 1920
Visible = 0 'False
Width = 1815
End
Begin VB.Label Label4
Caption = "请输入口令:"
Height = 375
Left = 1560
TabIndex = 5
Top = 1440
Width = 1335
End
Begin VB.Label Label3
Caption = "请输入口令:"
Height = 375
Left = 1560
TabIndex = 4
Top = 840
Width = 1215
End
Begin VB.Label Label2
Caption = "请输入用户名:"
Height = 255
Left = 1560
TabIndex = 2
Top = 360
Width = 1335
End
Begin VB.Label label1
Caption = "已有用户:"
Height = 255
Left = 0
TabIndex = 0
Top = 120
Width = 1095
End
End
Attribute VB_Name = "zcxyh"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private time As Integer
Private Sub Form_Activate()
Text1.SetFocus
End Sub
Private Sub Form_Load()
Data1.DatabaseName = App.Path + "\tsglxx.mdb"
Data1.RecordSource = "yhxx"
time = 0
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Call Text1_LostFocus
End If
End Sub
Private Sub Text1_LostFocus()
Data1.Recordset.FindFirst "username=" & "'" & Text1.Text & "'"
If Data1.Recordset.NoMatch Then
Text2.SetFocus
Else
MsgBox ("已有该用户名,再重新输入")
Text1.SetFocus
End If
End Sub
Private Sub Text2_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text3.SetFocus
End If
End Sub
Private Sub Text2_LostFocus()
Text3.SetFocus
End Sub
Private Sub Text3_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Call Text3_LostFocus1
End If
End Sub
Private Sub Text3_LostFocus1()
Dim k As Integer
If Text2.Text <> Text3.Text Then
MsgBox ("两次输入的口令不一致")
Text2.SetFocus
Else
Data1.Recordset.AddNew
Data1.Recordset.Fields("username") = Text1.Text
Data1.Recordset.Fields("userpass") = Text2.Text
Data1.Recordset.Update
Data1.Refresh
k = MsgBox("用户注册已成功,继续注册吗?", vbYesNo)
If k = vbYes Then
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text1.SetFocus
Else
Unload Me
End If
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -