发新话题
打印

如何在关闭后将改变的值保存进text中,下次运行时也存在,

使用OPEN函数

Private Sub Form_Load()
Dim aa As String
Text1.Text = ""
Open "c:\1.txt" For Input As #1
Do Until EOF(1)
    Line Input #1, aa
    Text1.Text = Text1.Text & aa & vbCrLf
Loop

Close #1
End Sub

Private Sub Form_Unload(Cancel As Integer)
Open "c:\1.txt" For Output As #1
Print #1, Text1.Text
Close #1
End Sub

TOP

发新话题