Results 1 to 4 of 4

Thread: How to open a saved listbox?

  1. #1

    Thread Starter
    New Member DrLector's Avatar
    Join Date
    Feb 2003
    Posts
    11

    How to open a saved listbox?

    Hi
    I'm making an adressbook.I fill in lastname, firstname, city & phonenumber, each in a textbox. By clicking on a Comm.Button everything goes into a listbox (items sorted on lastname). To SAVE everything I use next code:

    Dim intT As Integer
    Dim F As Integer
    Dim strLijst As String
    On Error Resume Next
    F = FreeFile
    Open "Filename.extension" For Output As #F
    Print
    For intT = 1 To List1.ListCount
    Print #F, List1.List(intT - 1)
    Next intT
    Close #F
    End If
    Does anyone have the code to OPEN the listbox? THX

  2. #2

  3. #3
    -= B u g S l a y e r =- peet's Avatar
    Join Date
    Aug 2000
    Posts
    9,629
    VB Code:
    1. Private Sub Command1_Click()
    2.     Dim s As String
    3.     List1.Clear
    4.     Open "C:\TEST.TXT" For Input As #1
    5.     Do While Not EOF(1)
    6.         Line Input #1, s
    7.         List1.AddItem s
    8.     Loop
    9.     Close #1
    10. End Sub
    -= a peet post =-

  4. #4

    Thread Starter
    New Member DrLector's Avatar
    Join Date
    Feb 2003
    Posts
    11

    listbox

    Code is working well...thanks a lot.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width