Option Explicit
Private Sub Command1_Click()
"儲存列表框內容
Dim i As Integer
Open "d:\list1.txt" For Output As #1 "自己設定儲存路徑
For i = 0 To List1.ListCount - 1
Print #1, List1.List(i)
Next
Close #1
End Sub
Private Sub Command2_Click()
"開啟檔案到列表框
Dim strLine As String
Open "d:\list1.txt" For Input As #1
Do While Not EOF(1)
Line Input #1, strLine "按行新增
List1.AddItem strLine
Loop
close
Option Explicit
Private Sub Command1_Click()
"儲存列表框內容
Dim i As Integer
Open "d:\list1.txt" For Output As #1 "自己設定儲存路徑
For i = 0 To List1.ListCount - 1
Print #1, List1.List(i)
Next
Close #1
End Sub
Private Sub Command2_Click()
"開啟檔案到列表框
Dim strLine As String
Open "d:\list1.txt" For Input As #1
Do While Not EOF(1)
Line Input #1, strLine "按行新增
List1.AddItem strLine
Loop
close
End Sub