gta58号升级档:VB中Combobox的用法

来源:百度文库 编辑:高考问答 时间:2024/04/28 02:25:29
我用
Combo1.AddItem txtnew.Text
增加了combobox的列表项目,但重新运行程序的时候增加的列表就没有了,怎么才能保存住呢?

将信息保存在其他文件中去,如文本文档。
open app.path & "\" & "info.txt" for output as #1
print txtnew.text
close #1
'于是txtnew的信息存放在程序目录下的info.txt文件中了

open app.path & "\" & "info.txt" for input as #1
txtnew.text=strconv(inputb(lof(1),1),vbunicode)
close #1
'于是信息又重新读入在txtnew中去了。

VB没有保存在内部的功能,除非用二进制方式添加在程序尾部。
但麻烦不合法奏效。