Results 1 to 7 of 7

Thread: [RESOLVED] Populate a Listbox

Threaded View

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Oct 2008
    Posts
    251

    Resolved [RESOLVED] Populate a Listbox

    i have figured it out how to fill a listbox with a textfile

    but cant do the rest do have to split the string add them to the list index
    For i = 1 To UBound(split)

    my text file is like this

    one
    ......... blue
    ......... red
    tow
    ......... green
    ......... yellow

    i have 2 list box i want to load the string one and tow into list1
    and when a user click on a list1 item one fill the list2 index with

    blue
    red
    and so on

    thanks

    Private Sub Form_Load()
    Dim txtstring As String
    Open App.Path & "\pictuer.text" For Input As #1
    list1.Clear
    While Not EOF(1)
    Input #1, txtstring
    list1.AddItem txtstring
    Wend
    Close #1
    End Sub




    text file
    .............................
    one
    ......... blue
    ......... red
    tow
    ......... green
    ......... yellow

    Last edited by bordino; Jan 24th, 2010 at 03:24 AM.

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