Results 1 to 3 of 3

Thread: About list box & labels... Hurry

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2000
    Location
    Karhula, Finland
    Posts
    4

    Post

    How can I get the list items into a label boxes? I have 20 Label boxes (label1(0) Label1(1) etc...) and a list box.
    Now I need to get list items into a label box, so that item 1 goes to label1(0), item 2 goes to label1(1) etc...
    How can I do this?

    This won't work:
    dim count as integer
    count = 0
    while count < n do
    item_val = label1(count)
    list1.additem(item_val)
    count = count + 1
    loop


    And how can I remove items from listbox (style=checked)
    This won't work correctly:

    i = 0
    intMaxItems = List1.ListCount - 1
    Do While i <= intMaxItems
    If List1.Selected(i) = True Then
    List1.RemoveItem i
    intMaxItems = intMaxItems - 1
    Else
    i = i + 1
    End If
    Loop

    Thank you!

  2. #2
    Lively Member Maartin's Avatar
    Join Date
    Jan 2000
    Location
    Benoni, Gauteng, South-Africa
    Posts
    99

    Post

    Go and have a look in your mailbox.



    ------------------
    Have Fun.
    Maartin.
    [email protected]
    -----------------------


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

    Post

    It is very easy to do.

    Code:
    Dim i As Integer
    
    For i = 0 To List1.ListCount - 1
        Label(i) = List1.List(i)
    Next
    ------------------

    Serge

    Senior Programmer Analyst
    [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