form6.frm

来自「MIS系统开发实例(VB+SQL SERVER2000)」· FRM 代码 · 共 197 行

FRM
197
字号
VERSION 5.00
Begin VB.Form Form6 
   BackColor       =   &H80000018&
   BorderStyle     =   1  'Fixed Single
   Caption         =   "管理员注册"
   ClientHeight    =   3600
   ClientLeft      =   45
   ClientTop       =   450
   ClientWidth     =   4680
   LinkTopic       =   "Form6"
   MaxButton       =   0   'False
   ScaleHeight     =   3600
   ScaleWidth      =   4680
   StartUpPosition =   3  '窗口缺省
   Begin VB.TextBox Text4 
      Appearance      =   0  'Flat
      Height          =   270
      Left            =   1800
      MaxLength       =   5
      TabIndex        =   10
      Top             =   2280
      Width           =   1815
   End
   Begin VB.TextBox Text3 
      Appearance      =   0  'Flat
      Height          =   270
      IMEMode         =   3  'DISABLE
      Left            =   1800
      PasswordChar    =   "*"
      TabIndex        =   8
      Top             =   1800
      Width           =   1815
   End
   Begin VB.CommandButton Command2 
      BackColor       =   &H00FFC0C0&
      Caption         =   "取消"
      Height          =   375
      Left            =   2880
      Style           =   1  'Graphical
      TabIndex        =   6
      Top             =   2880
      Width           =   975
   End
   Begin VB.CommandButton Command1 
      BackColor       =   &H00FFC0C0&
      Caption         =   "提交"
      Height          =   375
      Left            =   1800
      Style           =   1  'Graphical
      TabIndex        =   5
      Top             =   2880
      Width           =   975
   End
   Begin VB.TextBox Text2 
      Appearance      =   0  'Flat
      Height          =   270
      IMEMode         =   3  'DISABLE
      Left            =   1800
      MaxLength       =   8
      PasswordChar    =   "*"
      TabIndex        =   4
      Top             =   1320
      Width           =   1815
   End
   Begin VB.TextBox Text1 
      Appearance      =   0  'Flat
      Height          =   270
      Left            =   1800
      MaxLength       =   8
      TabIndex        =   2
      Top             =   840
      Width           =   1815
   End
   Begin VB.Label Label5 
      BackStyle       =   0  'Transparent
      Caption         =   "输 入 姓 名"
      ForeColor       =   &H00004080&
      Height          =   255
      Left            =   600
      TabIndex        =   9
      Top             =   2400
      Width           =   1095
   End
   Begin VB.Label Label4 
      BackStyle       =   0  'Transparent
      Caption         =   "验 证 密 码"
      ForeColor       =   &H00004080&
      Height          =   255
      Left            =   600
      TabIndex        =   7
      Top             =   1800
      Width           =   1095
   End
   Begin VB.Image Image1 
      Height          =   360
      Left            =   240
      Picture         =   "Form6.frx":0000
      Stretch         =   -1  'True
      Top             =   120
      Width           =   360
   End
   Begin VB.Label Label3 
      BackStyle       =   0  'Transparent
      Caption         =   "编 辑 密 码"
      ForeColor       =   &H00004080&
      Height          =   255
      Left            =   600
      TabIndex        =   3
      Top             =   1320
      Width           =   1095
   End
   Begin VB.Label Label2 
      BackStyle       =   0  'Transparent
      Caption         =   "编辑用户名"
      ForeColor       =   &H00004080&
      Height          =   375
      Left            =   600
      TabIndex        =   1
      Top             =   840
      Width           =   975
   End
   Begin VB.Label Label1 
      BackStyle       =   0  'Transparent
      Caption         =   "注册管理员"
      BeginProperty Font 
         Name            =   "隶书"
         Size            =   15
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   720
      TabIndex        =   0
      Top             =   240
      Width           =   1695
   End
End
Attribute VB_Name = "Form6"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
If Text1 = "" Then
    MsgBox "请编辑用户名", vbOKOnly + vbInformation, "提示"
    Text1.SetFocus
    Exit Sub
End If
If Text2 = "" Then
    MsgBox "请编辑密码", vbOKOnly + vbInformation, "提示"
    Text2.SetFocus
    Exit Sub
End If
If Text3 = "" Then
    MsgBox "请验证密码", vbOKOnly + vbInformation, "提示"
    Text3.SetFocus
    Exit Sub
End If
If Text4 = "" Then
    MsgBox "请输入姓名", vbOKOnly + vbInformation, "提示"
    Text4.SetFocus
    Exit Sub
End If
If StrComp(Text2, Text3, 1) <> 0 Then
    MsgBox "", vbOKOnly + vbInformation, ""
    Text3 = ""
    Text3.SetFocus
    Exit Sub
End If
Call adoopen
sql = "select * from xiaoshouman where xiaono='" & Text1 & "'"
Call rs(sql)
If Not adors.EOF Then
    MsgBox "该用户名已经存在,请重新输入!", vbOKOnly, ""
    Text1 = ""
    Text1.SetFocus
    Call adoclose
    Exit Sub
End If
Call adoclose
Call adoopen
adocon.Execute "insert into xiaoshouman values('" & Text1 & "','" & Text2 & "','" & Text4 & "')"
adocon.Close
Set adocon = Nothing
End Sub

Private Sub Command2_Click()
Unload Me
End Sub

Private Sub Form_Load()
  Move MDIForm1.Left + (MDIForm1.Width - Me.Width) / 2, MDIForm1.Top + 3000
End Sub

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?