📄 form3.frm
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form Form3
BackColor = &H8000000B&
Caption = "管理系统"
ClientHeight = 5895
ClientLeft = 2850
ClientTop = 465
ClientWidth = 7725
LinkTopic = "Form3"
MaxButton = 0 'False
Picture = "Form3.frx":0000
ScaleHeight = 5895
ScaleWidth = 7725
Begin MSAdodcLib.Adodc Adodc1
Height = 375
Left = 0
Top = 0
Visible = 0 'False
Width = 1200
_ExtentX = 2117
_ExtentY = 661
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 2
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Documents and Settings\soft\桌面\课程表代码1\db1.mdb;Persist Security Info=False"
OLEDBString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Documents and Settings\soft\桌面\课程表代码1\db1.mdb;Persist Security Info=False"
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "main"
Caption = "Adodc1"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin VB.TextBox Text1
DataField = "编号"
DataSource = "Adodc1"
Height = 300
Index = 0
Left = 3360
Locked = -1 'True
TabIndex = 26
Top = 1080
Width = 2500
End
Begin VB.TextBox Text1
DataField = "课程名称"
DataSource = "Adodc1"
Height = 300
Index = 1
Left = 3360
Locked = -1 'True
TabIndex = 1
Top = 1440
Width = 2500
End
Begin VB.CommandButton Command10
Caption = "下一条"
Height = 300
Left = 1680
TabIndex = 25
Top = 4800
Width = 1200
End
Begin VB.CommandButton Command9
Caption = "上一条"
Height = 300
Left = 1680
TabIndex = 24
Top = 4440
Width = 1200
End
Begin VB.CommandButton Command8
Caption = "显示全部"
Height = 300
Left = 1680
TabIndex = 17
Top = 5160
Width = 1200
End
Begin VB.CommandButton Command7
Caption = "取 消"
Height = 300
Left = 5040
TabIndex = 15
Top = 4800
Width = 1200
End
Begin VB.CommandButton Command6
Caption = "确认删除"
Height = 300
Left = 5040
TabIndex = 14
Top = 4440
Visible = 0 'False
Width = 1200
End
Begin VB.TextBox Text1
DataField = "上课地点"
DataSource = "Adodc1"
Height = 300
Index = 7
Left = 3360
Locked = -1 'True
TabIndex = 7
Top = 3600
Width = 2500
End
Begin VB.TextBox Text1
DataField = "上课时间"
DataSource = "Adodc1"
Height = 300
Index = 6
Left = 3360
Locked = -1 'True
TabIndex = 6
Top = 3240
Width = 2500
End
Begin VB.CommandButton Command5
Caption = "退 出"
Height = 300
Left = 5040
TabIndex = 12
Top = 5160
Width = 1200
End
Begin VB.CommandButton Command4
Caption = "删 除"
Height = 300
Left = 3360
TabIndex = 11
Top = 5160
Width = 1200
End
Begin VB.CommandButton Command3
Caption = "修 改"
Height = 300
Left = 3360
TabIndex = 10
Top = 4800
Width = 1200
End
Begin VB.CommandButton Command2
Caption = "确 定"
Height = 300
Left = 5040
TabIndex = 9
Top = 4440
Width = 1200
End
Begin VB.CommandButton Command1
Caption = "添 加"
Height = 300
Index = 0
Left = 3360
TabIndex = 8
Top = 4440
Width = 1200
End
Begin VB.TextBox Text1
DataField = "总学时"
DataSource = "Adodc1"
Height = 300
Index = 5
Left = 3360
Locked = -1 'True
TabIndex = 5
Top = 2880
Width = 2500
End
Begin VB.TextBox Text1
DataField = "上课班级"
DataSource = "Adodc1"
Height = 300
Index = 4
Left = 3360
Locked = -1 'True
TabIndex = 4
Top = 2520
Width = 2500
End
Begin VB.TextBox Text1
DataField = "任课教师"
DataSource = "Adodc1"
Height = 300
Index = 3
Left = 3360
Locked = -1 'True
TabIndex = 3
Top = 2160
Width = 2500
End
Begin VB.TextBox Text1
DataField = "课程学分"
DataSource = "Adodc1"
Height = 300
Index = 2
Left = 3360
Locked = -1 'True
TabIndex = 2
Top = 1800
Width = 2500
End
Begin VB.Line Line1
X1 = 360
X2 = 7440
Y1 = 4200
Y2 = 4200
End
Begin VB.Label Label9
BackStyle = 0 'Transparent
Caption = "上课地点"
Height = 255
Index = 0
Left = 1920
TabIndex = 23
Top = 3600
Width = 855
End
Begin VB.Label Label8
BackStyle = 0 'Transparent
Caption = "上课时间"
Height = 255
Index = 0
Left = 1920
TabIndex = 22
Top = 3240
Width = 975
End
Begin VB.Label Label7
BackStyle = 0 'Transparent
Caption = "总学时"
Height = 255
Index = 0
Left = 2040
TabIndex = 21
Top = 2880
Width = 735
End
Begin VB.Label Label6
BackStyle = 0 'Transparent
Caption = "上课班级"
Height = 255
Index = 0
Left = 1920
TabIndex = 20
Top = 2520
Width = 855
End
Begin VB.Label Label5
BackStyle = 0 'Transparent
Caption = "任课教师"
Height = 255
Index = 0
Left = 1920
TabIndex = 19
Top = 2160
Width = 855
End
Begin VB.Label Label4
BackStyle = 0 'Transparent
Caption = "课程学分"
Height = 255
Index = 0
Left = 1920
TabIndex = 18
Top = 1800
Width = 855
End
Begin VB.Label Label3
BackStyle = 0 'Transparent
Caption = "课程名称"
Height = 255
Index = 0
Left = 1920
TabIndex = 16
Top = 1440
Width = 855
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "编 号 "
Height = 255
Index = 0
Left = 2040
TabIndex = 13
Top = 1080
Width = 615
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "课 程 管 理 系 统"
BeginProperty Font
Name = "楷体_GB2312"
Size = 15.75
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 1920
TabIndex = 0
Top = 240
Width = 4335
End
End
Attribute VB_Name = "Form3"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub updatedata() '判断文本框是否为空
Dim i As Integer
Dim k As String
For i = 0 To 7
If Text1(i).Text = "" Then
MsgBox "请认真填写,记录不可以为空!"
Text1(i).SetFocus
Exit Sub
End If
Next i
End Sub
Private Sub kongtext() '清空文本框
Dim i As Integer
For i = 0 To 7
Text1(i).Text = ""
Next i
End Sub
Private Sub Command1_Click(Index As Integer) '添加按钮
Dim i As Integer
For i = 0 To 7
Text1(i).Locked = False
Next i
Command2.Visible = True
Adodc1.Recordset.AddNew
Call kongtext '清空文本框函数
Call b
End Sub
Private Sub Command10_Click()
If Adodc1.Recordset.EOF Then
Adodc1.Recordset.MoveFirst
Else
Adodc1.Recordset.MoveNext
End If
End Sub
Private Sub Command2_Click() '确定按钮
Call updatedata
Call yin
End Sub
Private Sub Command3_Click() '修改按钮
Dim i As Integer
Command1(0).Enabled = False
Command3.Enabled = False
Command4.Enabled = False
Command5.Enabled = False
Command7.Visible = True
For i = 0 To 7
Text1(i).Locked = False
Next i
Command2.Visible = True
End Sub
Private Sub Command4_Click() '删除按钮
Call b
Command6.Visible = True
Command7.Visible = True
Command7.Enabled = True
End Sub
Private Sub Command5_Click() '退出按钮
End
End Sub
Private Sub yin()
Dim i As Integer
If IsNumeric(Trim(Text1(0).Text)) Then
For i = 0 To 7
If Text1(i).Text = "" Then
Command2.Enabled = True
Call b
Else
Command2.Enabled = True
Text1(i).Locked = True '文本矿功能是否可用
Call a
Adodc1.Recordset.MoveFirst
End If
Next i
Else
MsgBox "编号字段请输入数字"
Text1(0).Text = ""
End If
End Sub
Private Sub Command6_Click() '确定删除按钮
Call a
Command6.Visible = False
On Error Resume Next
Adodc1.Recordset.Delete
Adodc1.Recordset.MoveNext
If Adodc1.Recordset.EOF Then Adodc1.Recordset.MoveLast
End Sub
Private Sub Command7_Click() '取消按钮
Dim i As Integer
Call a
Command2.Visible = True
Command6.Visible = False
For i = 0 To 7
Text1(i).Locked = True
Next i
End Sub
Private Sub Command8_Click()
Form5.Show
End Sub
Private Sub Command9_Click()
If Adodc1.Recordset.BOF Then
Adodc1.Recordset.MoveLast
Else
Adodc1.Recordset.MovePrevious
End If
End Sub
Private Sub tuichu_Click()
End
End Sub
Private Sub a() '按钮可用
Command1(0).Enabled = True
Command3.Enabled = True
Command4.Enabled = True
Command5.Enabled = True
Command7.Enabled = True
Command8.Enabled = True
Command9.Enabled = True
Command10.Enabled = True
End Sub
Private Sub b() '按钮不可用
Command1(0).Enabled = False
Command3.Enabled = False
Command4.Enabled = False
Command5.Enabled = False
Command7.Enabled = False
Command8.Enabled = False
Command9.Enabled = False
Command10.Enabled = False
End Sub
Private Sub Label5_Click(Index As Integer)
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -