|
-
Jul 17th, 2008, 06:58 AM
#2
Re: save/load
Use the below code:
Code:
Private Sub cmdLoad_Click()
Dim F
Dim Temp As String
F = FreeFile
Open "c:\file1.dat" For Input As #F
Do While Not EOF(F)
Input #F, Temp
List1.AddItem Temp
Loop
Close #F
MsgBox "Loaded"
End Sub
Private Sub cmdSave_Click()
Dim F
F = FreeFile
Open "c:\file1.dat" For Output As #F
For i = 0 To List1.ListCount
Print #F, Str(List1.List(i))
Next i
Close #F
MsgBox "Saved"
End Sub
If my post was helpful to you, then express your gratitude using Rate this Post. 
And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet
Social Group: VBForums - Developers from India
Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|