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

📄 main.frm

📁 Visual Basic开发实用编程200例 数据库编程实例
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Login 
   Caption         =   "登录学生信息管理系统"
   ClientHeight    =   3195
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   3885
   Icon            =   "Main.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MDIChild        =   -1  'True
   ScaleHeight     =   3195
   ScaleWidth      =   3885
   Begin VB.Frame Frame1 
      Height          =   1575
      Left            =   240
      TabIndex        =   5
      Top             =   120
      Width           =   3375
      Begin VB.TextBox txtPassWord 
         Height          =   270
         IMEMode         =   3  'DISABLE
         Left            =   1080
         MaxLength       =   20
         PasswordChar    =   "*"
         TabIndex        =   1
         Text            =   "123"
         Top             =   960
         Width           =   1935
      End
      Begin VB.TextBox txtUserName 
         Height          =   270
         Left            =   1080
         MaxLength       =   20
         TabIndex        =   0
         Text            =   "admin"
         Top             =   480
         Width           =   1935
      End
      Begin VB.Label Label2 
         Caption         =   "密码:"
         Height          =   255
         Left            =   360
         TabIndex        =   7
         Top             =   960
         Width           =   735
      End
      Begin VB.Label Label1 
         Caption         =   "用户名:"
         Height          =   255
         Left            =   360
         TabIndex        =   6
         Top             =   480
         Width           =   855
      End
   End
   Begin VB.CommandButton cmdOK 
      Caption         =   "登录"
      Default         =   -1  'True
      Height          =   375
      Left            =   2280
      TabIndex        =   2
      Top             =   2040
      Width           =   1215
   End
   Begin VB.CommandButton cmdRegister 
      Caption         =   "注册新用户"
      Height          =   855
      Left            =   360
      TabIndex        =   3
      Top             =   2040
      Width           =   1215
   End
   Begin VB.CommandButton cmdCancel 
      Cancel          =   -1  'True
      Caption         =   "取消"
      Height          =   375
      Left            =   2280
      TabIndex        =   4
      Top             =   2520
      Width           =   1215
   End
End
Attribute VB_Name = "Login"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

Private Sub cmdCancel_Click()
    Unload Login
End Sub

Private Sub cmdOK_Click()
    If txtUserName.Text = "" Then
        MsgBox "请填写用户名!", vbOKOnly + vbInformation, "注意"
        txtUserName.SetFocus
        Exit Sub
    ElseIf txtPassword.Text = "" Then
        MsgBox "请填写密码!", vbOKOnly + vbInformation, "注意"
        txtPassword.SetFocus
        Exit Sub
    End If
    
    g_bLogin = True
    
    If IsExistUser(txtUserName, txtPassword) = True Then
        Unload Login
        frmSearch.Show
    Else
        If IsExistUser(txtUserName, "") = True Then
            MsgBox "密码不正确!请重试……", vbOKOnly + vbInformation, "错误"
        Else
            MsgBox "无此用户!请先注册……", vbOKOnly + vbInformation, "错误"
            cmdRegister.SetFocus
        End If
    End If
End Sub

Private Sub cmdRegister_Click()
    Unload Login
    Register.Show
End Sub

Private Sub Form_Load()
    mdiFrm.mnuFileLog.Enabled = False
End Sub

Private Sub Form_Unload(Cancel As Integer)
    mdiFrm.mnuFileLog.Enabled = True
End Sub

⌨️ 快捷键说明

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