📄 frmlessonedit.frm
字号:
VERSION 5.00
Begin VB.Form FrmLessonEdit
BorderStyle = 1 'Fixed Single
Caption = "编辑课程信息"
ClientHeight = 2760
ClientLeft = 45
ClientTop = 330
ClientWidth = 5280
Icon = "FrmLessonEdit.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2760
ScaleWidth = 5280
StartUpPosition = 2 '屏幕中心
Begin VB.Frame Frame1
Height = 1815
Left = 240
TabIndex = 7
Top = 120
Width = 4815
Begin VB.TextBox txtName
Height = 300
Left = 1200
MaxLength = 100
TabIndex = 0
Top = 300
Width = 3375
End
Begin VB.TextBox txtTerm
Height = 300
Left = 1200
MaxLength = 20
TabIndex = 3
Top = 1260
Width = 975
End
Begin VB.TextBox txtTeacher
Height = 300
Left = 3600
MaxLength = 50
TabIndex = 2
Top = 780
Width = 975
End
Begin VB.TextBox txtHours
Height = 300
Left = 3600
MaxLength = 100
TabIndex = 4
Top = 1260
Width = 975
End
Begin VB.ComboBox ComboType
Height = 300
ItemData = "FrmLessonEdit.frx":0CCA
Left = 1200
List = "FrmLessonEdit.frx":0CD4
Style = 2 'Dropdown List
TabIndex = 1
Top = 780
Width = 975
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "课程名称"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 180
Left = 240
TabIndex = 12
Top = 360
Width = 720
End
Begin VB.Label Label6
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "学期设置"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 180
Left = 240
TabIndex = 11
Top = 1320
Width = 720
End
Begin VB.Label Label4
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "授课教师"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 180
Left = 2640
TabIndex = 10
Top = 840
Width = 720
End
Begin VB.Label Label5
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "课时设置"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 180
Left = 2640
TabIndex = 9
Top = 1320
Width = 720
End
Begin VB.Label Label8
AutoSize = -1 'True
BackColor = &H00FFC0C0&
BackStyle = 0 'Transparent
Caption = "课程类型"
Height = 180
Left = 240
TabIndex = 8
Top = 840
Width = 720
End
End
Begin VB.CommandButton Cmd_Cancel
Cancel = -1 'True
Caption = "取 消"
Height = 400
Left = 2848
MouseIcon = "FrmLessonEdit.frx":0CE8
MousePointer = 99 'Custom
Style = 1 'Graphical
TabIndex = 6
Top = 2160
Width = 1300
End
Begin VB.CommandButton Cmd_OK
Caption = "确 定"
Default = -1 'True
Height = 400
Left = 1133
MouseIcon = "FrmLessonEdit.frx":0FF2
MousePointer = 99 'Custom
Style = 1 'Graphical
TabIndex = 5
Top = 2160
Width = 1300
End
End
Attribute VB_Name = "FrmLessonEdit"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public Modify As Boolean '插入=false,修改=true
Public OriId As Integer
Private Sub Cmd_Cancel_Click()
Unload Me
End Sub
Private Sub Cmd_OK_Click()
'判断是否输入了课程名称
If Len(Trim(txtName)) = 0 Then
MsgBox "请输入课程名称"
txtName.SetFocus
txtName.SelStart = 0
txtName.SelLength = Len(txtName)
Exit Sub
End If
'把用户录入的数据赋值到MyLesson对象的成员变量中
With MyLesson
.LessonName = MakeStr(txtName)
.LessonType = Trim(ComboType.Text)
.Teacher = MakeStr(txtTeacher)
.Term = MakeStr(txtTerm)
.Hours = Val(txtHours)
'根据变量Modify决定是插入新数据,还是更新已有的数据
If Modify = False Then
.Insert
Else
Call .Update(OriId)
End If
End With
'关闭窗口
Unload Me
End Sub
Private Sub txtHours_KeyPress(KeyAscii As Integer)
If In_Int(KeyAscii) = False Then
KeyAscii = 0
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -