向组合框里添加为什么保存不住呀??
通过
Private Sub 款式_Click()
Dim ads As String
Do While (1)
ads = InputBox("添加新的款式名", "添加")
If Not ads = "" Then
Exit Do
End If
Loop
Combo1.AddItem ads
Combo6.AddItem ads
End Sub
向组合框里输入字串 但是生成为EXE 后为什么添加了,关了运行文件后再打开添加的东东那没有呀呢
如何保存住组合框里的东东呀
[解决办法]
Private Sub Command1_Click() ads = InputBox("添加新的款式名", "添加") If ads = "" Then Exit Sub Combo1.AddItem adsEnd SubPrivate Sub Form_Load() If Dir("c:\test.txt") = "" Then Exit Sub Combo1.Text = "" Dim MyString As String Open "c:\test.txt" For Input As #1 Do While Not EOF(1) DoEvents Line Input #1, MyString Combo1.AddItem MyString Loop Close #1End SubPrivate Sub Form_Unload(Cancel As Integer) Dim i As Integer Open "c:\test.txt" For Output As #3 For i = 0 To Combo1.ListCount - 1 Print #3, Combo1.List(i) Next i Close #3End Sub
[解决办法]