发布网友
共2个回答
热心网友
在程序中加入如下代码
文本框的内容 将会存入当前路径下的“小程序.txt”文本文档中
下次打开程序 会读取
同时实现
“关闭它的时候保存它的修改”
Private Sub Form_Load()
if dir(App.Path & "\小程序.txt")="" then
Open App.Path & "\小程序.txt" For Output As #1
close #1
endif
Open App.Path & "\小程序.txt" For Input As #1
Input #1, s
Close #1
Text1.Text = s
End Sub
Private Sub Form_Unload(Cancel As Integer)
Open App.Path & "\小程序.txt" For Output As #1
Write #1, Text1.Text
Close #1
End Sub
热心网友
把保存的按钮点一下就好了啊。。。
或者说你关的时候它会提示你要不要保存。你点“是”就行了。