Results 1 to 3 of 3

Thread: Extracting data from listbox

  1. #1

    Thread Starter
    New Member
    Join Date
    Dec 1999
    Posts
    3

    Post

    Hello!
    I'm using VB6.0 working model at home
    and have a question about listboxes. How can I extract info from the listbox and transfer
    it to textboxes. The program requires that the user enter info into 5 diff texboxes and
    hit an add cmd button to transfer the contents into the listbox.Then, when user selects a line from the listbox,the contents
    in that line should transfer back to the corresponding textboxes. Someone told me to
    use the SPLIT function. Any help will be
    appreciated.
    THANKS.

  2. #2
    Member
    Join Date
    Jul 1999
    Posts
    40

    Post

    in the list box click event just put your code to do what you want.
    List1_Click()
    ie...text1.text = list1.text

  3. #3
    Serge's Avatar
    Join Date
    Feb 1999
    Location
    Scottsdale, Arizona, USA
    Posts
    2,744

    Post

    This example would assume that you have a Control array for TextBoxes.

    To insert into a ListBox
    Code:
    Dim i As Integer
    
    For i = 0 To Text1.Ubound
        List1.AddItem Text1(i).Text
    Next
    Put this on double click event of the ListBox
    Code:
    Text1(List1.ListIndex).Text = List.List(List1.ListIndex)
    ------------------

    Serge

    Software Developer
    [email protected]
    [email protected]
    ICQ#: 51055819


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