?? frmsystemnewuser.frm
字號:
VERSION 5.00
Begin VB.Form frmSystemNewUser
BorderStyle = 3 'Fixed Dialog
Caption = "新用戶注冊"
ClientHeight = 2670
ClientLeft = 45
ClientTop = 330
ClientWidth = 5205
Icon = "frmSystemNewUser.frx":0000
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2670
ScaleWidth = 5205
ShowInTaskbar = 0 'False
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton cmdExit
Caption = "取消"
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 3840
TabIndex = 3
Top = 1155
Width = 1215
End
Begin VB.CommandButton cmdDenJ
BackColor = &H00C0C0C0&
Caption = "確定"
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 3840
MaskColor = &H00FFFFFF&
Style = 1 'Graphical
TabIndex = 2
Top = 600
UseMaskColor = -1 'True
Width = 1215
End
Begin VB.PictureBox SSFrame1
BeginProperty Font
Name = "宋體"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 2235
Left = 240
ScaleHeight = 2175
ScaleWidth = 3435
TabIndex = 4
Top = 180
Width = 3495
Begin VB.TextBox txtPwd
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
IMEMode = 3 'DISABLE
Left = 1770
PasswordChar = "*"
TabIndex = 1
Top = 1290
Width = 1515
End
Begin VB.TextBox txtUser
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1770
TabIndex = 0
Top = 660
Width = 1515
End
Begin VB.Label Label2
Alignment = 2 'Center
Caption = "用戶密碼:"
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 375
Left = 210
TabIndex = 6
Top = 1350
Width = 1335
End
Begin VB.Label Label1
Alignment = 2 'Center
Caption = "用戶名稱:"
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 375
Left = 210
TabIndex = 5
Top = 660
Width = 1335
End
End
End
Attribute VB_Name = "frmSystemNewUser"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim Recuser As Recordset
Private Sub cmdDenJ_Click()
'用戶名不能重復
Recuser.FindFirst "user='" + Trim(txtUser) + "'"
If Not Recuser.NoMatch Then
MsgBox "您輸入的用戶名已被使用", vbExclamation + vbOKOnly, "信息"
txtUser = ""
txtUser.SetFocus
Exit Sub
End If
'密碼不能為空
If Len(txtPwd) = 0 Then
MsgBox "密碼不能為空", vbExclamation + vbOKOnly, "信息"
txtPwd = ""
txtPwd.SetFocus
Exit Sub
End If
'添加新用戶
Recuser.AddNew
Recuser.Fields("user") = txtUser
Recuser.Fields("pwd") = txtPwd
If txtUser.Text = "" Or txtPwd.Text = "" Then
txtPwd.SetFocus
End If
Recuser.Update
MsgBox "祝賀您!您已登記成功", vbExclamation + vbOKOnly, "信息"
txtPwd = ""
txtUser = ""
Unload Me
End Sub
Private Sub cmdExit_Click()
Unload Me
End Sub
Private Sub Form_Load()
Set Recuser = Dbstudent.OpenRecordset("select * from user", dbOpenDynaset)
End Sub
Private Sub txtPwd_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Call cmdDenJ_Click
End If
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -