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

📄 frmduty.frm

📁 一款非常适合中小学教学任务不是很繁重的管理程序
💻 FRM
字号:
VERSION 5.00
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX"
Object = "{E95A2510-F3D1-416D-823B-4F840FE98091}#3.0#0"; "Command.ocx"
Object = "{3A6644DE-3402-11D9-9DE7-C33FAA87690A}#1.0#0"; "WinXPCEngine.ocx"
Begin VB.Form frmDuty 
   ClientHeight    =   9015
   ClientLeft      =   60
   ClientTop       =   60
   ClientWidth     =   8985
   ControlBox      =   0   'False
   LinkTopic       =   "Form1"
   MDIChild        =   -1  'True
   Picture         =   "frmDuty.frx":0000
   ScaleHeight     =   9015
   ScaleWidth      =   8985
   WindowState     =   2  'Maximized
   Begin WinXPC_Engine.WindowsXPC WindowsXPC1 
      Left            =   2610
      Top             =   4185
      _ExtentX        =   6588
      _ExtentY        =   1085
      ColorScheme     =   2
      Common_Dialog   =   0   'False
   End
   Begin VB.TextBox txtORow 
      Alignment       =   2  'Center
      Height          =   375
      Left            =   4320
      TabIndex        =   16
      Top             =   2280
      Width           =   1575
   End
   Begin VB.TextBox txtIRow 
      Alignment       =   2  'Center
      Height          =   375
      Left            =   4320
      TabIndex        =   14
      Top             =   1800
      Width           =   1575
   End
   Begin VB.ComboBox cboStudent 
      Height          =   315
      Left            =   6600
      Style           =   2  'Dropdown List
      TabIndex        =   4
      Top             =   2880
      Width           =   1575
   End
   Begin MSFlexGridLib.MSFlexGrid mgridODuty 
      Height          =   1695
      Left            =   3840
      TabIndex        =   0
      Top             =   2880
      Width           =   2535
      _ExtentX        =   4471
      _ExtentY        =   2990
      _Version        =   393216
      FixedRows       =   0
      FixedCols       =   0
      ForeColor       =   8388608
      BackColorFixed  =   16512
      ForeColorFixed  =   8388736
      ForeColorSel    =   65535
      BackColorBkg    =   16777215
      GridColorFixed  =   4210752
   End
   Begin MSFlexGridLib.MSFlexGrid mgridIDuty 
      Height          =   1575
      Left            =   3840
      TabIndex        =   6
      Top             =   4800
      Width           =   2535
      _ExtentX        =   4471
      _ExtentY        =   2778
      _Version        =   393216
      FixedRows       =   0
      FixedCols       =   0
      ForeColor       =   8388608
      BackColorFixed  =   16512
      ForeColorFixed  =   8388736
      ForeColorSel    =   65535
      BackColorBkg    =   16777215
      GridColorFixed  =   4210752
   End
   Begin CSCommand.Command cmdFind 
      Height          =   375
      Left            =   1200
      TabIndex        =   9
      Top             =   6840
      Width           =   975
      _ExtentX        =   1720
      _ExtentY        =   661
      IconAlign       =   0
      Icon            =   "frmDuty.frx":151DA4
      Caption         =   "显示"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
   End
   Begin CSCommand.Command cmdExit 
      Height          =   375
      Left            =   7800
      TabIndex        =   10
      Top             =   6840
      Width           =   975
      _ExtentX        =   1720
      _ExtentY        =   661
      IconAlign       =   0
      Icon            =   "frmDuty.frx":151DC0
      Caption         =   "关闭"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
   End
   Begin CSCommand.Command cmdIModiy 
      Height          =   375
      Left            =   2520
      TabIndex        =   11
      Top             =   6840
      Width           =   975
      _ExtentX        =   1720
      _ExtentY        =   661
      IconAlign       =   0
      Icon            =   "frmDuty.frx":151DDC
      Caption         =   "修改班内"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
   End
   Begin CSCommand.Command cmdPrint 
      Height          =   375
      Left            =   5160
      TabIndex        =   12
      Top             =   6840
      Width           =   975
      _ExtentX        =   1720
      _ExtentY        =   661
      IconAlign       =   0
      Icon            =   "frmDuty.frx":151DF8
      Caption         =   "打印"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
   End
   Begin CSCommand.Command cmdRModiy 
      Height          =   375
      Left            =   6480
      TabIndex        =   13
      Top             =   6840
      Width           =   975
      _ExtentX        =   1720
      _ExtentY        =   661
      IconAlign       =   0
      Icon            =   "frmDuty.frx":151E14
      Caption         =   "修改人数"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
   End
   Begin CSCommand.Command cmdOModiy 
      Height          =   375
      Left            =   3840
      TabIndex        =   18
      Top             =   6840
      Width           =   975
      _ExtentX        =   1720
      _ExtentY        =   661
      IconAlign       =   0
      Icon            =   "frmDuty.frx":151E30
      Caption         =   "修改班外"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
   End
   Begin VB.Label Label6 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "班外人数"
      Height          =   195
      Left            =   3120
      TabIndex        =   17
      Top             =   2400
      Width           =   720
   End
   Begin VB.Label Label5 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "班内人数"
      Height          =   195
      Left            =   3120
      TabIndex        =   15
      Top             =   1920
      Width           =   720
   End
   Begin VB.Label Label4 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "班外"
      Height          =   195
      Index           =   1
      Left            =   3120
      TabIndex        =   8
      Top             =   3120
      Width           =   360
   End
   Begin VB.Label Label4 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "班内"
      Height          =   195
      Index           =   0
      Left            =   3120
      TabIndex        =   7
      Top             =   4920
      Width           =   360
   End
   Begin VB.Label Label3 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "值日生设置"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   24
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00008000&
      Height          =   555
      Left            =   3720
      TabIndex        =   5
      Top             =   600
      Width           =   2325
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "今日日期: "
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   18
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   435
      Left            =   3120
      TabIndex        =   3
      Top             =   1200
      Width           =   1695
   End
   Begin VB.Label lblDate 
      Alignment       =   2  'Center
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "今日日期: "
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00004080&
      Height          =   300
      Left            =   5160
      TabIndex        =   2
      Top             =   1320
      Width           =   1605
   End
   Begin VB.Label Label2 
      Alignment       =   2  'Center
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "值日生:"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00004000&
      Height          =   300
      Left            =   960
      TabIndex        =   1
      Top             =   3000
      Width           =   960
   End
End
Attribute VB_Name = "frmDuty"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim strSql As String
Dim RS As ADODB.Recordset
Dim bln As Boolean
Private Sub cboStudent_Click()
'添加数据
If bln = True Then
    Me.mgridIDuty.Text = Me.cboStudent.Text
Else
    Me.mgridODuty.Text = Me.cboStudent.Text
End If
End Sub
Private Sub cmdExit_Click()
Unload Me
End Sub
Private Sub cmdFind_Click()
'显示
On Error Resume Next
Me.cboStudent.Visible = False
strSql = "select 学号,姓名 from 学生基本情况表 where 学号 in (select * from 班内值日表)"
writeMS strSql, Me.mgridIDuty
strSql = "select 学号,姓名 from 学生基本情况表 where 学号 in (select * from 班外值日表)"
writeMS strSql, Me.mgridODuty
Me.mgridIDuty.Rows = Me.mgridIDuty.Rows - 1
Me.mgridODuty.Rows = Me.mgridODuty.Rows - 1
Me.txtIRow.Text = Me.mgridIDuty.Rows - 1
Me.txtORow.Text = Me.mgridODuty.Rows - 1
End Sub
Private Sub cmdIModiy_Click()
'修改室内
On Error Resume Next
Dim i As Integer
strSql = "delete * from 班内值日表"
dbOperate strSql
For i = 1 To Me.mgridIDuty.Rows - 1
    strSql = "insert into 班内值日表 values('" & Trim(Me.mgridIDuty.TextMatrix(i, 0)) & "')"
    dbOperate strSql
Next i
End Sub
Private Sub cmdOModiy_Click()
'修改室外
On Error Resume Next
strSql = "delete * from 班外值日表"
dbOperate strSql
Dim i As Integer
For i = 1 To Me.mgridODuty.Rows - 1
    strSql = "insert into 班外值日表 values('" & Trim(Me.mgridODuty.TextMatrix(i, 0)) & "')"
    dbOperate strSql
Next i
End Sub

Private Sub cmdPrint_Click()
'打印
Me.cboStudent.Visible = False
writeMSFlexGrid Me.mgridIDuty, "室内值日生"
writeMSFlexGrid Me.mgridODuty, "室外值日生"
End Sub
Private Sub cmdRModiy_Click()
'修改人数
Me.mgridIDuty.Rows = Me.txtIRow.Text + 1
Me.mgridODuty.Rows = Me.txtORow.Text + 1
End Sub
Private Sub Form_Load()
On Error Resume Next
Me.lblDate.Caption = Format(Date, "yyyy年mm月dd日")
strSql = "select 学号 from 学生基本情况表"
Set RS = dbSelect(strSql)
While Not RS.EOF
    Me.cboStudent.AddItem RS.Fields(0)
    RS.MoveNext
Wend
Call cmdFind_Click
Me.cboStudent.Visible = False
Me.WindowsXPC1.InitSubClassing
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Me.cboStudent.Visible = False
End Sub

Private Sub mgridIDuty_Click()
Call mgridIDuty_RowColChange
End Sub
Private Sub mgridIDuty_RowColChange()
'室内
If Me.mgridIDuty.Row <> 0 And Me.mgridIDuty.Col = 0 Then
    Me.cboStudent.Visible = True
    Me.cboStudent.Left = Me.mgridIDuty.CellLeft + Me.mgridIDuty.Left
    Me.cboStudent.Top = Me.mgridIDuty.CellTop + Me.mgridIDuty.Top
Else
    Me.cboStudent.Visible = False
End If
    bln = True
End Sub
Private Sub mgridODuty_Click()
Call mgridODuty_RowColChange
End Sub
Private Sub mgridODuty_RowColChange()
'室外
If Me.mgridODuty.Row <> 0 And Me.mgridODuty.Col = 0 Then
    Me.cboStudent.Visible = True
    Me.cboStudent.Left = Me.mgridODuty.CellLeft + Me.mgridODuty.Left
    Me.cboStudent.Top = Me.mgridODuty.CellTop + Me.mgridODuty.Top
Else
    Me.cboStudent.Visible = False
End If
    bln = False
End Sub

Private Sub txtIRow_Change()
If Not IsNumeric(Trim(txtIRow.Text)) Then
    MsgBox "请输入数字!", vbOKCancelvbok + vbExclamation, "提示"
End If
End Sub

Private Sub txtORow_Change()
If Not IsNumeric(Trim(txtORow.Text)) Then
    MsgBox "请输入数字!", vbOKCancelvbok + vbExclamation, "提示"
End If
End Sub

⌨️ 快捷键说明

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