逍遥疯子 2006-6-7 15:34
如何在关闭后将改变的值保存进text中,下次运行时也存在,
如何在关闭后将改变的值保存进text中,下次运行时也存在,
例如,我将text中文本的值改变后附给text2,text2的内容发了生改变,但我关闭窗口后,内容就消失了,如何让text2的内容在关闭窗口后不依旧保留其中,并且下次运行时也存在,怎么解决,
Nothing 2006-6-7 21:24
使用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