📄 例10_5_4.frm
字号:
VERSION 5.00
Begin VB.Form FRM10_5_2
Caption = "Form1"
ClientHeight = 3960
ClientLeft = 60
ClientTop = 450
ClientWidth = 6120
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
LinkTopic = "Form1"
ScaleHeight = 3960
ScaleWidth = 6120
StartUpPosition = 3 '窗口缺省
Begin VB.TextBox Text4
Height = 615
Left = 2760
TabIndex = 11
Top = 1200
Width = 1335
End
Begin VB.OptionButton Option2
Caption = "女"
Height = 495
Left = 4320
TabIndex = 10
Top = 3120
Width = 735
End
Begin VB.OptionButton Option1
Caption = "男"
Height = 495
Left = 3000
TabIndex = 9
Top = 3120
Width = 855
End
Begin VB.TextBox Text3
Height = 615
Left = 1200
TabIndex = 8
Top = 3000
Width = 1215
End
Begin VB.TextBox Text2
Height = 615
Left = 4080
TabIndex = 7
Top = 2160
Width = 1575
End
Begin VB.TextBox Text1
Height = 615
Left = 1200
TabIndex = 6
Top = 2160
Width = 1215
End
Begin VB.CommandButton Command2
Caption = "显示记录"
Height = 615
Left = 3600
TabIndex = 1
Top = 240
Width = 1695
End
Begin VB.CommandButton Command1
Caption = "写入记录"
Height = 615
Left = 240
TabIndex = 0
Top = 240
Width = 1575
End
Begin VB.Label Label4
BorderStyle = 1 'Fixed Single
Caption = "姓名"
Height = 615
Left = 3000
TabIndex = 5
Top = 2160
Width = 855
End
Begin VB.Label Label3
BorderStyle = 1 'Fixed Single
Caption = "年龄"
Height = 615
Left = 240
TabIndex = 4
Top = 3000
Width = 735
End
Begin VB.Label Label2
BorderStyle = 1 'Fixed Single
Caption = "学号"
Height = 615
Left = 240
TabIndex = 3
Top = 2160
Width = 735
End
Begin VB.Label Label1
BorderStyle = 1 'Fixed Single
Caption = "记录号"
Height = 615
Left = 1320
TabIndex = 2
Top = 1200
Width = 1215
End
End
Attribute VB_Name = "FRM10_5_2"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Type Student
StrXH As String * 8
StrXM As String * 8
StrXB As String * 1
IntNL As Integer
End Type
Dim XueSheng As Student
Dim IntPos As Integer
Private Sub Command1_Click()
XueSheng.StrXH = Text1
XueSheng.StrXM = Text2
XueSheng.IntNL = Val(Text3)
If Option1.Value Then
XueSheng.StrXB = 1
Else
XueSheng.StrXB = 0
End If
IntPos = Val(Text4)
Open App.Path + "\XSDA.DAT" For Random As #1 Len = Len(XueSheng)
Put #1, IntPos, XueSheng
Close
End Sub
Private Sub Command2_Click()
IntPos = Val(Text4)
Open App.Path + "\XSDA.DAT" For Random As #1 Len = Len(XueSheng)
Get #1, IntPos, XueSheng
Close
Text1 = XueSheng.StrXH
Text2 = XueSheng.StrXM
Text3 = XueSheng.IntNL
If XueSheng.StrXB = "1" Then
Option1.Value = True
Option2.Value = False
Else
Option1.Value = False
Option2.Value = True
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -