frmsclass.frm
来自「一款非常适合中小学教学任务不是很繁重的管理程序」· FRM 代码 · 共 351 行
FRM
351 行
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 frmSClass
ClientHeight = 8775
ClientLeft = 60
ClientTop = 60
ClientWidth = 9855
ControlBox = 0 'False
LinkTopic = "Form1"
MDIChild = -1 'True
Picture = "frmSClass.frx":0000
ScaleHeight = 8775
ScaleWidth = 9855
WindowState = 2 'Maximized
Begin WinXPC_Engine.WindowsXPC WindowsXPC1
Left = 3060
Top = 4095
_ExtentX = 6588
_ExtentY = 1085
ColorScheme = 2
Common_Dialog = 0 'False
End
Begin VB.ComboBox cboTerm
Height = 315
ItemData = "frmSClass.frx":151DA4
Left = 3840
List = "frmSClass.frx":151DC0
Style = 2 'Dropdown List
TabIndex = 15
Top = 1200
Width = 3015
End
Begin VB.ComboBox cboName
Height = 315
Left = 3840
Style = 2 'Dropdown List
TabIndex = 14
Top = 1920
Width = 3015
End
Begin MSFlexGridLib.MSFlexGrid mgridAll
Height = 3975
Left = 1080
TabIndex = 5
Top = 3240
Width = 8055
_ExtentX = 14208
_ExtentY = 7011
_Version = 393216
FixedRows = 0
FixedCols = 0
AllowUserResizing= 3
End
Begin VB.ComboBox cboTeacher
Height = 315
Left = 3840
Style = 2 'Dropdown List
TabIndex = 4
Top = 2640
Width = 3015
End
Begin CSCommand.Command cmdAdd
Height = 375
Left = 3120
TabIndex = 6
Top = 7680
Width = 975
_ExtentX = 1720
_ExtentY = 661
IconAlign = 0
Icon = "frmSClass.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 cmdFind
Height = 375
Left = 1800
TabIndex = 7
Top = 7680
Width = 1095
_ExtentX = 1931
_ExtentY = 661
IconAlign = 0
Icon = "frmSClass.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 cmdExit
Height = 375
Left = 8400
TabIndex = 8
Top = 7680
Width = 975
_ExtentX = 1720
_ExtentY = 661
IconAlign = 0
Icon = "frmSClass.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 cmdDel
Height = 375
Left = 4440
TabIndex = 9
Top = 7680
Width = 975
_ExtentX = 1720
_ExtentY = 661
IconAlign = 0
Icon = "frmSClass.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 CSCommand.Command cmdPrint
Height = 375
Left = 7080
TabIndex = 10
Top = 7680
Width = 975
_ExtentX = 1720
_ExtentY = 661
IconAlign = 0
Icon = "frmSClass.frx":151E4C
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 cmdModiy
Height = 375
Left = 5670
TabIndex = 13
Top = 7680
Width = 975
_ExtentX = 1720
_ExtentY = 661
IconAlign = 0
Icon = "frmSClass.frx":151E68
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 Label5
Caption = "解释:"
ForeColor = &H00008000&
Height = 255
Left = 240
TabIndex = 12
Top = 840
Width = 855
End
Begin VB.Label Label4
BackStyle = 0 'Transparent
Caption = "在添加和删除,修改时需添加主键所有的项进行教师选择即可然后点击所需的服务按钮!"
ForeColor = &H00008000&
Height = 975
Left = 240
TabIndex = 11
Top = 1440
Width = 1935
End
Begin VB.Label Label3
Alignment = 2 'Center
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "课程名(主键)"
Height = 195
Index = 1
Left = 2400
TabIndex = 3
Top = 2040
Width = 1260
End
Begin VB.Label Label2
Alignment = 2 'Center
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "授课教师编号"
Height = 195
Left = 2640
TabIndex = 2
Top = 2640
Width = 1095
End
Begin VB.Label Label1
Alignment = 2 'Center
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
ForeColor = &H00000040&
Height = 435
Left = 4440
TabIndex = 1
Top = 360
Width = 1500
End
Begin VB.Label Label3
Alignment = 2 'Center
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "学期(主键) "
Height = 195
Index = 0
Left = 2400
TabIndex = 0
Top = 1320
Width = 1245
End
End
Attribute VB_Name = "frmSClass"
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
Private Sub cmdAdd_Click()
'添加
On Error Resume Next
If Me.cboName.Text <> "" Or Me.cboTerm.Text <> "" Then
strSql = "select * from 课程设置表 where 学期=" & Val(Trim(cboTerm.Text))
strSql = strSql & "and 课程名字='" & Trim(Me.cboName.Text) & "'"
Set RS = dbSelect(strSql)
If RS.EOF Then
strSql = "insert into 课程设置表 values("
strSql = strSql & Val(Trim(cboTerm.Text))
strSql = strSql & ",'" & Trim(cboName.Text)
strSql = strSql & "','" & Trim(cboTeacher.Text)
strSql = strSql & "')"
dbOperate strSql
Else
MsgBox "库中已有!", vbOKOnly + vbExclamation, "提示"
End If
End If
End Sub
Private Sub cmdDel_Click()
'删除
On Error Resume Next
strSql = "delete * from 课程设置表 where"
strSql = strSql & " 课程名字='" & Trim(cboName.Text) & "'and"
strSql = strSql & " 学期=" & Val(Trim(cboTerm.Text))
dbOperate strSql
End Sub
Private Sub cmdExit_Click()
Unload Me
End Sub
Private Sub cmdFind_Click()
'查找
On Error Resume Next
If Trim(cboTerm.Text) <> "" Then
strSql = "select 课程设置表.课程名字,课程设置表.授课教师编号,"
strSql = strSql & "教师基本情况表.姓名"
strSql = strSql & " from 教师基本情况表,课程设置表 where"
strSql = strSql & " 课程设置表.学期=" & Val(Trim(cboTerm.Text))
strSql = strSql & " and 教师基本情况表.编号=课程设置表.授课教师编号"
writeMS strSql, Me.mgridAll
Else
MsgBox "主键不能为空", vbOKOnlyvbok + vbExclamation, "提示"
End If
End Sub
Private Sub cmdModiy_Click()
'修改
Call cmdDel_Click
Call cmdAdd_Click
End Sub
Private Sub cmdPrint_Click()
writeMSFlexGrid Me.mgridAll, "课程设置表(" & Trim(txtTerm.Text) & "学期)"
End Sub
Private Sub Form_Load()
'初始化
On Error Resume Next
Dim i As Integer
strSql = "select 编号 from 教师基本情况表"
Set RS = dbSelect(strSql)
While Not RS.EOF
cboTeacher.AddItem RS.Fields(0)
RS.MoveNext
Wend
strSql = "select * from 成绩表"
Set RS = dbSelect(strSql)
For i = 1 To RS.Fields.Count - 4
cboName.AddItem RS.Fields(i).Name
Next i
cboName.ListIndex = 0
cboTeacher.ListIndex = 0
cboTerm.ListIndex = 0
Me.WindowsXPC1.InitSubClassing
End Sub
Private Sub txtTerm_Change()
If Not IsNumeric(Trim(txtTerm.Text)) Then
MsgBox "请输入数字!", vbOKCancelvbok + vbExclamation, "提示"
End If
End Sub
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?