【VB开源代码栏目提醒】:本文主要为网学会员提供Ex14_6.frm,希望对需要Ex14_6.frm网友有所帮助,学习一下!
VERSION 5.00
Begin VB.Form Ex14_6
Caption = "读写顺序文件"
ClientHeight = 4395
ClientLeft = 60
ClientTop = 450
ClientWidth = 4980
LinkTopic = "Form1"
ScaleHeight = 4395
ScaleWidth = 4980
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command3
Caption = "退出"
Height = 375
Left = 3360
TabIndex = 12
Top = 2160
Width = 1095
End
Begin VB.CommandButton Command2
Caption = "显示"
Height = 375
Left = 3360
TabIndex = 11
Top = 1560
Width = 1095
End
Begin VB.PictureBox Picture1
Height = 1335
Left = 240
ScaleHeight = 1275
ScaleWidth = 4395
TabIndex = 10
Top = 2880
Width = 4455
End
Begin VB.CommandButton Command1
Caption = "保存"
Height = 375
Left = 3360
TabIndex = 9
Top = 960
Width = 1095
End
Begin VB.TextBox Text4
Height = 375
Left = 1440
TabIndex = 8
Top = 2400
Width = 1455
End
Begin VB.TextBox Text3
Height = 375
Left = 1440
TabIndex = 6
Top = 1920
Width = 1455
End
Begin VB.TextBox Text2
Height = 375
Left = 1440
TabIndex = 4
Top = 1440
Width = 1455
End
Begin VB.TextBox Text1
Height = 375
Left = 1440
TabIndex = 2
Top = 960
Width = 1455
End
Begin VB.Label Label5
Caption = "成绩:"
Height = 255
Left = 600
TabIndex = 7
Top = 2520
Width = 615
End
Begin VB.Label Label4
Caption = "年龄:"
Height = 255
Left = 600
TabIndex = 5
Top = 2040
Width = 615
End
Begin VB.Label Label3
Caption = ":"
Height = 255
Left = 600
TabIndex = 3
Top = 1560
Width = 615
End
Begin VB.Label Label2
Caption = ":"
Height = 255
Left = 600
TabIndex = 1
Top = 1080
Width = 615
End
Begin VB.Label Label1
Caption = "请输入学生信息"
BeginProperty Font
Name = "宋体"
Size = 18
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 960
TabIndex = 0
Top = 240
Width = 2775
End
End
Attribute VB_Name = "Ex14_6"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Open App.Path & "\student.txt" For Append As #1
'将文本框中的内容写入文件
Print #1, Text1.Text, Text2.Text, Text3.Text, Text4.Text
Close #1
msg = MsgBox("保存完毕!继续输入学生信息吗?", vbYesNo + vbQuestion)
If msg = 6 Then '设置各个文本框Text属性为空
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text1.SetFocus
End If
End Sub
Private Sub Command2_Click()
Dim str As String
Dim lines As String
Picture1.Cls
Open App.Path & "\student.txt" For Input As #1
Do While Not EOF(1) '将文件中的内容一行一行的读出
Line Input #1, str
lines = lines + str + Chr(13) + Chr(10)
Loop
Close
Picture1.Print lines '将文件中内容打印在图片框上
End Sub
Private Sub Command3_Click()
End
End Sub
上一篇:
Ex14_3.frm
下一篇:
法律专业开题报告范文