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

📄 frmscore.frm

📁 北大青鸟教学管理系统是学习规范编程范本.功能非常完备,代码编写有章法,不可多得
💻 FRM
📖 第 1 页 / 共 2 页
字号:
VERSION 5.00
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "msflxgrd.ocx"
Begin VB.Form frmScoreG 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "学员成绩管理"
   ClientHeight    =   7320
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   6870
   Icon            =   "frmScore.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MDIChild        =   -1  'True
   MinButton       =   0   'False
   ScaleHeight     =   7320
   ScaleWidth      =   6870
   Begin VB.CommandButton cmdLast 
      Caption         =   ">>"
      Height          =   350
      Left            =   1440
      TabIndex        =   28
      Top             =   4500
      Width           =   360
   End
   Begin VB.CommandButton cmdPrevious 
      Caption         =   "<"
      Height          =   350
      Left            =   720
      TabIndex        =   27
      Top             =   4500
      Width           =   360
   End
   Begin VB.CommandButton cmdFirst 
      Caption         =   "<<"
      Height          =   350
      Left            =   360
      TabIndex        =   26
      Top             =   4500
      Width           =   360
   End
   Begin VB.CommandButton cmdNext 
      Caption         =   ">"
      Height          =   350
      Left            =   1080
      TabIndex        =   25
      Top             =   4500
      Width           =   360
   End
   Begin VB.CommandButton cmdSaveScore 
      Caption         =   "保存成绩"
      Enabled         =   0   'False
      Height          =   350
      Left            =   5520
      TabIndex        =   24
      Top             =   4500
      Width           =   1095
   End
   Begin MSFlexGridLib.MSFlexGrid MsflxScore 
      Height          =   2295
      Left            =   240
      TabIndex        =   23
      Top             =   4920
      Width           =   6375
      _ExtentX        =   11245
      _ExtentY        =   4048
      _Version        =   393216
      Rows            =   3
      Cols            =   7
      FixedRows       =   2
      FocusRect       =   0
      SelectionMode   =   1
   End
   Begin VB.CommandButton cmdDelScore 
      Caption         =   "删除成绩"
      Enabled         =   0   'False
      Height          =   350
      Left            =   4320
      TabIndex        =   21
      Top             =   4500
      Width           =   1095
   End
   Begin VB.CommandButton cmdNewScore 
      Caption         =   "录入成绩"
      Enabled         =   0   'False
      Height          =   350
      Left            =   5520
      TabIndex        =   20
      Top             =   2350
      Width           =   1095
   End
   Begin VB.CommandButton cmdAddScore 
      Caption         =   "加入列表"
      Enabled         =   0   'False
      Height          =   350
      Left            =   3120
      TabIndex        =   19
      Top             =   4500
      Width           =   1095
   End
   Begin VB.Frame FraScore 
      Caption         =   "学员成绩录入"
      Enabled         =   0   'False
      Height          =   1750
      Left            =   240
      TabIndex        =   7
      Top             =   2650
      Width           =   6375
      Begin VB.TextBox txtRemark 
         Height          =   705
         Left            =   840
         MultiLine       =   -1  'True
         TabIndex        =   6
         Top             =   960
         Width           =   5295
      End
      Begin VB.TextBox txtScore 
         Height          =   320
         Left            =   5280
         TabIndex        =   3
         Top             =   240
         Width           =   855
      End
      Begin VB.TextBox txtTeacher 
         Height          =   320
         Left            =   4320
         TabIndex        =   5
         Top             =   600
         Width           =   1815
      End
      Begin VB.TextBox txtCourse 
         Height          =   320
         Left            =   840
         TabIndex        =   4
         Top             =   600
         Width           =   2175
      End
      Begin VB.TextBox txtExamDate 
         Height          =   320
         Left            =   3000
         TabIndex        =   2
         Top             =   240
         Width           =   1335
      End
      Begin VB.TextBox txtStudentNo 
         Enabled         =   0   'False
         Height          =   320
         Left            =   840
         Locked          =   -1  'True
         TabIndex        =   1
         Top             =   240
         Width           =   1215
      End
      Begin VB.Label Label9 
         AutoSize        =   -1  'True
         Caption         =   "任课老师"
         Height          =   180
         Left            =   3240
         TabIndex        =   18
         Top             =   670
         Width           =   720
      End
      Begin VB.Label Label10 
         AutoSize        =   -1  'True
         Caption         =   "课程名称"
         Height          =   180
         Left            =   120
         TabIndex        =   17
         Top             =   675
         Width           =   720
      End
      Begin VB.Label Label8 
         AutoSize        =   -1  'True
         Caption         =   "备注"
         Height          =   180
         Left            =   120
         TabIndex        =   16
         Top             =   960
         Width           =   360
      End
      Begin VB.Label Label7 
         AutoSize        =   -1  'True
         Caption         =   "考试成绩"
         Height          =   180
         Left            =   4440
         TabIndex        =   15
         Top             =   310
         Width           =   720
      End
      Begin VB.Label Label6 
         AutoSize        =   -1  'True
         Caption         =   "考试日期"
         Height          =   180
         Left            =   2160
         TabIndex        =   14
         Top             =   315
         Width           =   720
      End
      Begin VB.Label Label3 
         AutoSize        =   -1  'True
         Caption         =   "学号"
         Height          =   180
         Left            =   120
         TabIndex        =   13
         Top             =   315
         Width           =   360
      End
   End
   Begin VB.Frame Frame1 
      Caption         =   "学员名单检索"
      Height          =   2175
      Left            =   240
      TabIndex        =   0
      Top             =   120
      Width           =   6375
      Begin VB.CommandButton cmdRetrieve 
         Caption         =   "检索学员"
         Height          =   300
         Left            =   5040
         TabIndex        =   12
         Top             =   240
         Width           =   1095
      End
      Begin VB.ComboBox cmbStatus 
         Height          =   300
         ItemData        =   "frmScore.frx":0442
         Left            =   3480
         List            =   "frmScore.frx":045B
         Style           =   2  'Dropdown List
         TabIndex        =   11
         Top             =   240
         Width           =   1215
      End
      Begin VB.ComboBox cmbClass 
         Height          =   300
         ItemData        =   "frmScore.frx":0489
         Left            =   720
         List            =   "frmScore.frx":0490
         Style           =   2  'Dropdown List
         TabIndex        =   9
         Top             =   240
         Width           =   1335
      End
      Begin MSFlexGridLib.MSFlexGrid MsflxStuInfo 
         Height          =   1335
         Left            =   240
         TabIndex        =   22
         Top             =   720
         Width           =   5895
         _ExtentX        =   10398
         _ExtentY        =   2355
         _Version        =   393216
         Cols            =   5
         FocusRect       =   0
         SelectionMode   =   1
      End
      Begin VB.Label Label2 
         AutoSize        =   -1  'True
         Caption         =   "学员状态"
         Height          =   180
         Left            =   2640
         TabIndex        =   10
         Top             =   300
         Width           =   720
      End
      Begin VB.Label Label1 
         AutoSize        =   -1  'True
         Caption         =   "班级"
         Height          =   180
         Left            =   240
         TabIndex        =   8
         Top             =   300
         Width           =   360
      End
   End
End
Attribute VB_Name = "frmScoreG"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'学号 姓名 班级 状态
'学号 课程名称 任课老师 成绩 考试日期 备注
Option Explicit
Dim IfChanger As Boolean
Dim IfSave As Boolean

Private Sub cmdAddScore_Click()
    If txtCourse = "" Or txtTeacher = "" Or txtScore = "" Or txtExamDate = "" Or txtScore = "" Then
        MsgBox "请输入完整信息....", vbInformation + vbOKOnly, "信息不完整"
        txtExamDate.SetFocus
    Else
        MsflxScore.Row = MsflxScore.Rows - 1    '最后一条记录不为空则新增一条记录
        MsflxScore.Col = 1
        If MsflxScore.Text <> "" Then
            MsflxScore.AddItem Empty
        End If
        
        MsflxScore.Row = MsflxScore.Rows - 1
        MsflxScore.Col = 0
        MsflxScore.Text = MsflxScore.Row - 1
        MsflxScore.Col = 1
        MsflxScore.Text = txtStudentNo  '学号
        MsflxScore.Col = 2
        MsflxScore.Text = txtCourse     '课程名
        MsflxScore.Col = 3
        MsflxScore.Text = txtTeacher    '任课老师
        MsflxScore.Col = 4
        MsflxScore.Text = txtScore      '成绩
        MsflxScore.Col = 5
        MsflxScore.Text = txtExamDate   '考试日期
        MsflxScore.Col = 6
        MsflxScore.Text = txtRemark     '备注
        IfSave = True
        FraScore.Enabled = False        '保存完闭后禁用文本筐
    End If
End Sub

Private Sub cmdDelScore_Click()
    Dim intIndex As Integer
    If MsflxScore.Row >= 2 Then
        If MsflxScore.Rows > 3 Then
            MsflxScore.RemoveItem MsflxScore.Row
        ElseIf MsflxScore.Row = 2 Then
            For intIndex = 0 To 6
                MsflxScore.Col = intIndex
                MsflxScore.Text = ""
            Next intIndex
        End If
        cmdSaveScore.Enabled = True
    End If
    
End Sub

Private Sub cmdNewScore_Click()
    If MsflxStuInfo.Row <> 0 Then
        cmdAddScore.Enabled = True      '使两个按扭生效
        cmdSaveScore.Enabled = True
        FraScore.Enabled = True
        MsflxStuInfo.Col = 1
        txtStudentNo = MsflxStuInfo.Text
        txtExamDate = ""
        txtScore = ""
        txtCourse = ""
        txtTeacher = ""
        txtRemark = ""
        IfSave = False
    End If
End Sub

Private Sub cmdRetrieve_Click()
Dim intIndex As Integer
Dim SearchClass As String
Dim SearchStatus As String
On Error GoTo ErrLab
      
    Set Rst = Nothing        '清空记录集
    If cmbClass.Text = "所有" Then
        SearchClass = ""
    End If
    If cmbStatus.Text = "所有" Then
        SearchStatus = ""
    End If
    Rst.Filter = ("ClassNo='" & SearchClass & "' And Status='" & SearchStatus & "'")   '过滤信息
    
    Do While MsflxStuInfo.Rows > 2        '检索时先清空msflxstuinfo

⌨️ 快捷键说明

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