⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 main_czysz.frm

📁 这个原代码书上有,但是我把它做出来,与大家共享,希望大家喜欢
💻 FRM
字号:
VERSION 5.00
Begin VB.Form main_czysz 
   BackColor       =   &H00C0C0C0&
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "操作员设置"
   ClientHeight    =   3240
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   6120
   Icon            =   "main_czysz.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   3240
   ScaleWidth      =   6120
   ShowInTaskbar   =   0   'False
   StartUpPosition =   1  '所有者中心
   Begin VB.Data Data1 
      Caption         =   "Data1"
      Connect         =   "Access"
      DatabaseName    =   "D:\VB数据库开发实例解析\程序\宾馆客房管理系统\Kfgl.mdb"
      DefaultCursorType=   0  '缺省游标
      DefaultType     =   2  '使用 ODBC
      Exclusive       =   0   'False
      Height          =   345
      Left            =   -435
      Options         =   0
      ReadOnly        =   0   'False
      RecordsetType   =   1  'Dynaset
      RecordSource    =   "qxsz"
      Top             =   1680
      Visible         =   0   'False
      Width           =   1140
   End
   Begin VB.CommandButton Command2 
      BackColor       =   &H00C0C0C0&
      Caption         =   "取消"
      Height          =   375
      Left            =   2205
      Style           =   1  'Graphical
      TabIndex        =   8
      Top             =   2760
      Width           =   1575
   End
   Begin VB.CommandButton Command1 
      BackColor       =   &H00C0C0C0&
      Caption         =   "确定"
      Height          =   375
      Left            =   510
      Style           =   1  'Graphical
      TabIndex        =   7
      Top             =   2760
      Width           =   1575
   End
   Begin VB.CommandButton Command3 
      BackColor       =   &H00C0C0C0&
      Caption         =   "退出"
      Height          =   375
      Left            =   3930
      Style           =   1  'Graphical
      TabIndex        =   6
      Top             =   2760
      Width           =   1575
   End
   Begin VB.Frame Frame1 
      Height          =   2625
      Left            =   105
      TabIndex        =   0
      Top             =   75
      Width           =   5745
      Begin VB.TextBox Text1 
         BackColor       =   &H00FFFFFF&
         Height          =   345
         Left            =   2010
         TabIndex        =   3
         Top             =   1020
         Width           =   2880
      End
      Begin VB.TextBox Text2 
         BackColor       =   &H00FFFFFF&
         Height          =   345
         IMEMode         =   3  'DISABLE
         Left            =   2010
         MaxLength       =   6
         TabIndex        =   2
         Top             =   1545
         Width           =   2880
      End
      Begin VB.TextBox Text3 
         BackColor       =   &H00FFFFFF&
         Height          =   360
         IMEMode         =   3  'DISABLE
         Left            =   2010
         MaxLength       =   6
         PasswordChar    =   "*"
         TabIndex        =   1
         Top             =   2070
         Width           =   2880
      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          =   360
         Left            =   150
         TabIndex        =   5
         Top             =   210
         Width           =   5100
      End
      Begin VB.Label Label2 
         BackStyle       =   0  'Transparent
         Caption         =   "操作员                              密  码                              确  认"
         Height          =   1515
         Left            =   1395
         TabIndex        =   4
         Top             =   1080
         Width           =   1005
      End
   End
End
Attribute VB_Name = "main_czysz"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Form_Load()
 Data1.DatabaseName = App.Path & "\KFGL.MDB"     '自动识别数据库路径
End Sub
Private Sub Form_Activate()
 Text1.SetFocus     'text1获得焦点
End Sub
Private Sub Form_Unload(Cancel As Integer)
 main.Enabled = True
End Sub
Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
 If KeyCode = vbKeyReturn Then Text2.SetFocus     '回车text2获得焦点
End Sub
Private Sub text2_KeyDown(KeyCode As Integer, Shift As Integer)
 If KeyCode = vbKeyReturn Then Text3.SetFocus     '回车text3获得焦点
End Sub
Private Sub Text3_KeyDown(KeyCode As Integer, Shift As Integer)
 If KeyCode = vbKeyReturn Then Command1.SetFocus     '回车Command1获得焦点
End Sub
Private Sub Command1_Click()
 '保存操作员及密码
 If Text1.Text <> "" Then
  If Text2.Text <> "" Then
   Data1.Recordset.AddNew
   Data1.Recordset.Fields("操作员") = Text1.Text
   Data1.Recordset.Fields("密码") = Text2.Text
   Data1.Recordset.Update     '更新记录
   Data1.Refresh
   Text1.Text = "": Text2.Text = "": Text3.Text = ""
   MsgBox ("操作员设置成功!")
  End If
 Else
  MsgBox ("请输入操作员!")
 End If
End Sub
Private Sub Command2_Click()
 Text1.Text = "": Text2.Text = "": Text3.Text = ""
End Sub
Private Sub Command3_Click()
 main.Enabled = True
 Unload Me
End Sub

⌨️ 快捷键说明

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