📄 frmadduser.frm
字号:
Top = 960
Width = 3975
End
Begin VB.Label Label7
BackStyle = 0 'Transparent
Caption = "新用户注册"
BeginProperty Font
Name = "方正舒体"
Size = 18
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 1200
TabIndex = 14
Top = 960
Width = 2055
End
Begin VB.Label Label6
BackStyle = 0 'Transparent
Caption = "欢迎注册新用户"
BeginProperty Font
Name = "方正舒体"
Size = 18
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000FF&
Height = 495
Left = 3240
TabIndex = 13
Top = 120
Width = 2655
End
Begin VB.Label Label5
BackStyle = 0 'Transparent
Caption = "请确认新密码"
BeginProperty Font
Name = "新宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 5160
TabIndex = 10
Top = 3600
Width = 1575
End
Begin VB.Label Label4
BackStyle = 0 'Transparent
Caption = "请输入新密码"
BeginProperty Font
Name = "新宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 5160
TabIndex = 9
Top = 2880
Width = 1575
End
Begin VB.Label Label3
BackStyle = 0 'Transparent
Caption = "请确认密码"
BeginProperty Font
Name = "新宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 600
TabIndex = 4
Top = 2520
Width = 1455
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "请输入密码"
BeginProperty Font
Name = "新宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 600
TabIndex = 3
Top = 2040
Width = 1335
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "请输入用户ID"
BeginProperty Font
Name = "新宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 480
TabIndex = 2
Top = 1440
Width = 1575
End
End
Attribute VB_Name = "frmadduser"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmdCancel_Click()
Unload Me
End Sub
Private Sub cmdno_Click()
Unload Me
End Sub
Private Sub cmdOK_Click()
Dim txtSQL As String
Dim mrc As ADODB.Recordset
Dim MsgText As String
If Trim(Text1.Text) = "" Then
MsgBox "请输入用户ID!", vbOKOnly + vbExclamation, "警告"
Exit Sub
Text1.SetFocus
Else
txtSQL = "select * from user_If "
Set mrc = ExecuteSQL(txtSQL, MsgText)
While (mrc.EOF = False)
If Trim(mrc.Fields(0)) = Trim(Text1) Then
MsgBox "用户已经存在,请重新输入用户ID!", vbOKOnly + vbExclamation, "警告"
Text1.SetFocus
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Exit Sub
Else
mrc.MoveNext
End If
Wend
End If
If Trim(Text2.Text) <> Trim(Text3.Text) Then
MsgBox "两次输入密码不一样,请确认!", vbOKOnly + vbExclamation, "警告"
Text2.SetFocus
Text2.Text = ""
Text3.Text = ""
Exit Sub
Else
If Text2.Text = "" Then
MsgBox "密码不能为空!", vbOKOnly + vbExclamation, "警告"
Text2.SetFocus
Text2.Text = ""
Text3.Text = ""
Else
mrc.AddNew
mrc.Fields(0) = Trim(Text1.Text)
mrc.Fields(1) = Trim(Text2.Text)
mrc.Update
mrc.Close
Me.Hide
MsgBox "用户注册成功!", vbOKOnly + vbExclamation, "用户注册"
End If
End If
End Sub
Private Sub cmdyes_Click()
Dim txtSQL, MsgText As String
Dim mrc As ADODB.Recordset
Dim rs As Boolean
rs = True
If Trim(Text4.Text) <> Trim(Text5.Text) Then
MsgBox "密码输入不正确!", vbOKOnly + vbExclamation, "警告"
Text4.SetFocus
Text4.Text = ""
Text5.Text = ""
Else
txtSQL = "select * from user_If where user_ID = '" & UserName & "'"
Set mrc = ExecuteSQL(txtSQL, MsgText)
If Text4.Text = "" Then
MsgBox "密码不能为空! 请输入密码!", vbOKOnly + vbExclamation, "警告"
rs = False
Text4.Text = ""
Text5.Text = ""
Text4.SetFocus
End If
If rs = True Then
mrc.Fields(1) = Text4.Text
mrc.Update
mrc.Close
MsgBox "密码修改成功!", vbOKOnly + vbExclamation, "修改密码"
Me.Hide
End If
End If
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then Text2.SetFocus
End Sub
Private Sub Text2_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then Text3.SetFocus
End Sub
Private Sub Text3_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then Text6.SetFocus
End Sub
Private Sub Text4_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then Text5.SetFocus
End Sub
Private Sub Text6_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then Text7.SetFocus
End Sub
Private Sub Text7_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then Text8.SetFocus
End Sub
Private Sub Text8_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then Text9.SetFocus
End Sub
Private Sub Text9_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then Text4.SetFocus
End Sub
Private Sub Timer1_Timer()
Label6.Left = Label6.Left - 10
If Label6.Left < 0 Then Label6.Left = Label6.Left + 8000
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -