📄 frmcourseinfo.frm
字号:
VERSION 5.00
Begin VB.Form frmAddcourseinfo
Caption = "添加课程信息"
ClientHeight = 3615
ClientLeft = 45
ClientTop = 345
ClientWidth = 7350
LinkTopic = "Form1"
ScaleHeight = 3615
ScaleWidth = 7350
StartUpPosition = 3 'Windows Default
Begin VB.ComboBox comboCoursetype
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 312
Left = 1560
TabIndex = 9
Top = 1200
Width = 1332
End
Begin VB.CommandButton Command2
Caption = "取消添加"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 492
Left = 3840
TabIndex = 8
Top = 2760
Width = 1452
End
Begin VB.CommandButton Command1
Caption = "确认添加"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 492
Left = 1320
TabIndex = 7
Top = 2760
Width = 1452
End
Begin VB.TextBox txtCoursedes
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 1452
Left = 4680
MultiLine = -1 'True
ScrollBars = 2 'Vertical
TabIndex = 6
Top = 1080
Width = 2412
End
Begin VB.TextBox txtCoursename
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 492
Left = 4680
TabIndex = 3
Top = 240
Width = 1332
End
Begin VB.TextBox txtCourseno
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 492
Left = 1560
TabIndex = 1
Top = 240
Width = 1332
End
Begin VB.Label Label4
Caption = "课程描述:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 252
Left = 3360
TabIndex = 5
Top = 1200
Width = 1212
End
Begin VB.Label Label3
Caption = "课程类型:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 252
Left = 240
TabIndex = 4
Top = 1200
Width = 1212
End
Begin VB.Label Label2
Caption = "课程名称:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 252
Left = 3360
TabIndex = 2
Top = 360
Width = 1212
End
Begin VB.Label Label1
Caption = "课程编号:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 252
Left = 240
TabIndex = 0
Top = 360
Width = 1212
End
End
Attribute VB_Name = "frmAddcourseinfo"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public Modify As Boolean '插入=false,修改=true
Public courseOK As Boolean
Private Sub Command1_Click()
'Dim mrc As ADODB.Recordset
' Dim MsgText As String
' Dim txtSQL As String
If Not Testtxt(txtCourseno.text) Then
MsgBox "请输入课程编号!", vbOKOnly + vbExclamation, "警告"
txtCourseno.SetFocus
Exit Sub
End If
If Not Testtxt(txtCoursename.text) Then
MsgBox "请输入课程名称!", vbOKOnly + vbExclamation, "警告"
txtCoursename.SetFocus
Exit Sub
End If
If Not Testtxt(comboCoursetype.text) Then
MsgBox "请选择课程类型!", vbOKOnly + vbExclamation, "警告"
comboCoursetype.SetFocus
Exit Sub
End If
If Not Testtxt(txtCoursedes.text) Then
MsgBox "请输入课程描述信息!", vbOKOnly + vbExclamation, "警告"
txtCoursedes.SetFocus
Exit Sub
End If
If Not IsNumeric(Trim(txtCourseno.text)) Then
MsgBox "请输入数字编号!", vbOKOnly + vbExclamation, "警告"
Exit Sub
txtCourseno.SetFocus
End If
Dim combo As Boolean
combo = InCombo(comboCoursetype.text, comboCoursetype)
If combo = False Then
Exit Sub
End If
With MyCour
.course_No = txtCourseno.text
.course_Name = MakeStr(txtCoursename)
.course_Type = MakeStr(comboCoursetype)
.course_Des = MakeStr(txtCoursedes)
If Modify = False Then
.Insert
Else
.Update (CurCour.course_No)
End If
End With
courseOK = True
MsgBox "添加课程信息成功!", vbOKOnly + vbExclamation, "添加课程信息"
Unload Me
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub form_load()
comboCoursetype.AddItem "必修"
comboCoursetype.AddItem "选修"
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -