VB6.0中如何保存和读取l两个list中的内容! 20
PrivateSubForm_Unload(CancelAsInteger)DimiAsLong,TempAsStringFori=0ToList1.ListCount-...
Private Sub Form_Unload(Cancel As Integer)
Dim i As Long, Temp As String
For i = 0 To List1.ListCount - 1
If Temp = "" Then
Temp = List1.List(i)
Else
Temp = Temp & vbNewLine & List1.List(i)
End If
Next i
Open IIf(Len(App.Path) = 3, App.Path, App.Path & "\") & "data.dat" For Output As #1
Print #1, List1.ListCount
Close #1
End Sub
Private Sub Form_Load()
Dim Path As String, Item As Long, Temp As String, i As Long
Path = IIf(Len(App.Path) = 3, App.Path, App.Path & "\") & "data.dat"
If Dir(Path, vbDirectory) = "" Then Exit Sub
Open Path For Input As #1
Line Input #1, Temp
Item = Val(Temp)
For i = 1 To Item
Line Input #1, Temp
List1.AddItem Temp
Next i
Close #1
End Sub
这是一个listbox的代码,两个怎么弄? 展开
Dim i As Long, Temp As String
For i = 0 To List1.ListCount - 1
If Temp = "" Then
Temp = List1.List(i)
Else
Temp = Temp & vbNewLine & List1.List(i)
End If
Next i
Open IIf(Len(App.Path) = 3, App.Path, App.Path & "\") & "data.dat" For Output As #1
Print #1, List1.ListCount
Close #1
End Sub
Private Sub Form_Load()
Dim Path As String, Item As Long, Temp As String, i As Long
Path = IIf(Len(App.Path) = 3, App.Path, App.Path & "\") & "data.dat"
If Dir(Path, vbDirectory) = "" Then Exit Sub
Open Path For Input As #1
Line Input #1, Temp
Item = Val(Temp)
For i = 1 To Item
Line Input #1, Temp
List1.AddItem Temp
Next i
Close #1
End Sub
这是一个listbox的代码,两个怎么弄? 展开
展开全部
‘一个list代码都是错的,给你重写一个,我不喜欢修改别人的代码 ,2个list思路一样自己修改
Dim filename As String
Private Sub Form_Unload(Cancel As Integer)
Dim i As Long, Temp As String
If Dir(filename) = "" Or List1.ListCount = 0 Then Exit Sub
Open filename For Output As #1
For i = 0 To List1.ListCount - 1
Print #1, List1.List(i)
Next
Close #1
End Sub
Private Sub Form_Load()
Dim arr, i As Integer
filename = App.path & IIf(Right(App.path, 1) = "\", "", "\") & "data.dat"
If Dir(filename) <> "" Then
Open filename For Input As #1
arr = Split(StrConv(InputB(LOF(1), 1), vbUnicode), vbNewLine)
Close #1
For i = 0 To UBound(arr)
If Len(arr(i)) > 0 Then List1.AddItem arr(i)
Next
End If
End Sub
Dim filename As String
Private Sub Form_Unload(Cancel As Integer)
Dim i As Long, Temp As String
If Dir(filename) = "" Or List1.ListCount = 0 Then Exit Sub
Open filename For Output As #1
For i = 0 To List1.ListCount - 1
Print #1, List1.List(i)
Next
Close #1
End Sub
Private Sub Form_Load()
Dim arr, i As Integer
filename = App.path & IIf(Right(App.path, 1) = "\", "", "\") & "data.dat"
If Dir(filename) <> "" Then
Open filename For Input As #1
arr = Split(StrConv(InputB(LOF(1), 1), vbUnicode), vbNewLine)
Close #1
For i = 0 To UBound(arr)
If Len(arr(i)) > 0 Then List1.AddItem arr(i)
Next
End If
End Sub
更多追问追答
追问
我是菜鸟不会改,你帮我下
追答
呵呵,保存文件中加个标示符,2个200个都一样,你为什么不自己试试呢?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询