📄 form1.frm
字号:
VERSION 5.00
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 3090
ClientLeft = 60
ClientTop = 450
ClientWidth = 4680
LinkTopic = "Form1"
ScaleHeight = 3090
ScaleWidth = 4680
StartUpPosition = 3 'Windows Default
Begin VB.CommandButton Command5
Caption = "查找"
Height = 375
Left = 1920
TabIndex = 16
Top = 2640
Width = 855
End
Begin VB.CommandButton Command4
Caption = "返回"
Height = 375
Left = 3840
TabIndex = 15
Top = 2640
Width = 735
End
Begin VB.CommandButton Command3
Caption = "删除"
Height = 375
Left = 2880
TabIndex = 14
Top = 2640
Width = 735
End
Begin VB.CommandButton Command2
Caption = "编辑"
Height = 375
Left = 960
TabIndex = 13
Top = 2640
Width = 855
End
Begin VB.CommandButton Command1
Caption = "添加"
Height = 375
Left = 120
TabIndex = 12
Top = 2640
Width = 735
End
Begin VB.Data Data1
Caption = "Data1"
Connect = "Access"
DatabaseName = "D:\myvb\stu.mdb"
DefaultCursorType= 0 'DefaultCursor
DefaultType = 2 'UseODBC
Exclusive = 0 'False
Height = 420
Left = 120
Options = 0
ReadOnly = 0 'False
RecordsetType = 0 'Table
RecordSource = "班级学生信息表"
Top = 2040
Width = 4335
End
Begin VB.TextBox Text6
DataField = "手机"
DataSource = "Data1"
Height = 495
Left = 2640
TabIndex = 11
Top = 1320
Width = 1935
End
Begin VB.TextBox Text5
DataField = "寝室电话"
DataSource = "Data1"
Height = 495
Left = 2640
TabIndex = 9
Top = 720
Width = 1935
End
Begin VB.TextBox Text4
DataField = "出生日期"
DataSource = "Data1"
Height = 495
Left = 2640
TabIndex = 6
Top = 120
Width = 1935
End
Begin VB.TextBox Text3
DataField = "性别"
DataSource = "Data1"
Height = 495
Left = 720
TabIndex = 5
Top = 1320
Width = 975
End
Begin VB.TextBox Text2
DataField = "姓名"
DataSource = "Data1"
Height = 495
Left = 720
TabIndex = 3
Top = 720
Width = 975
End
Begin VB.TextBox Text1
DataField = "学号"
DataSource = "Data1"
Height = 495
Left = 720
TabIndex = 0
Top = 120
Width = 975
End
Begin VB.Label Label6
BackStyle = 0 'Transparent
Caption = "手机"
Height = 255
Left = 1800
TabIndex = 10
Top = 1440
Width = 615
End
Begin VB.Label Label5
BackStyle = 0 'Transparent
Caption = "寝室电话"
Height = 255
Left = 1800
TabIndex = 8
Top = 840
Width = 735
End
Begin VB.Label Label4
BackStyle = 0 'Transparent
Caption = "出生日期"
Height = 375
Left = 1800
TabIndex = 7
Top = 240
Width = 735
End
Begin VB.Label Label3
BackStyle = 0 'Transparent
Caption = "性别"
Height = 255
Left = 120
TabIndex = 4
Top = 1440
Width = 375
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "姓名"
Height = 255
Left = 120
TabIndex = 2
Top = 840
Width = 495
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "学号"
Height = 255
Left = 120
TabIndex = 1
Top = 240
Width = 495
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
On Error Resume Next
Data1.Enabled = Not Data1.Enabled
Command2.Enabled = Not Command2.Enabled
Command3.Enabled = Not Command3.Enabled
Command4.Enabled = Not Command4.Enabled
If Command1.Caption = "添加" Then
Command1.Caption = "确认"
Data1.Recordset.AddNew
Else
Command1.Caption = "添加"
Data1.Recordset.Update
Data1.Recordset.MoveLast
End If
End Sub
Private Sub Command2_Click()
On Error Resume Next
Data1.Enabled = Not Data1.Enabled
Command1.Enabled = Not Command1.Enabled
Command3.Enabled = Not Command3.Enabled
Command4.Enabled = Not Command4.Enabled
If Command2.Caption = "编辑" Then
Command2.Caption = "确认"
Data1.Recordset.Edit
Else
Command1.Caption = "编辑"
Data1.Recordset.Update
End If
End Sub
Private Sub Command3_Click()
On Error Resume Next
Data1.Recordset.Delete
Data1.Recordset.MoveNext
If Data1.Recordset.EOF = True Then
Data1.Recordset.MoveLast
End If
End Sub
Private Sub Command4_Click()
Form3.Show
End Sub
Private Sub Command5_Click()
Form2.Show
End Sub
Private Sub Form_Paint()
Dim i As Integer
ScaleMode = 3
For i = 0 To 255
Line (0, i)-(Width, i), RGB(i, i, 255)
Next i
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -