Results 1 to 11 of 11

Thread: how to use a listbox with multiple selected entrys?

  1. #1

    Thread Starter
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729

    how to use a listbox with multiple selected entrys?

    how to work with them?

    how do i know the 1st row index and the last one? and the others? tks

  2. #2
    -= B u g S l a y e r =- peet's Avatar
    Join Date
    Aug 2000
    Posts
    9,629
    could u elaborate a bit please ?
    -= a peet post =-

  3. #3
    -= B u g S l a y e r =- peet's Avatar
    Join Date
    Aug 2000
    Posts
    9,629
    Not sure about this, but is this what u mean?

    VB Code:
    1. Private Sub Command1_Click()
    2.     'get checked items
    3.     Dim i As Integer
    4.     For i = 0 To List1.ListCount - 1
    5.         If List1.Selected(i) = True Then Debug.Print List1.List(i)
    6.     Next i
    7. End Sub
    -= a peet post =-

  4. #4

    Thread Starter
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729
    ah tks :-)

  5. #5

    Thread Starter
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729
    ah but look that will loop thruogh all files and if i have 1000++ files it will be 'boring' to the user see all that looping...anyways of 'hiding' it?

  6. #6
    -= B u g S l a y e r =- peet's Avatar
    Join Date
    Aug 2000
    Posts
    9,629
    Originally posted by PT Exorcist
    ah but look that will loop thruogh all files and if i have 1000++ files it will be 'boring' to the user see all that looping...anyways of 'hiding' it?
    not sure what u mean... just tested it on 1000 items... doesnt "show anything boring" at all?

    -= a peet post =-

  7. #7

    Thread Starter
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729
    and how to make a routine to delete them all? i tryed...

    VB Code:
    1. For i = 0 To List1.ListCount
    2.     List1.Selected(i) = True
    3.     If List1.Selected(i) = True Then List1.RemoveItem (i)
    4.     i = i + 1
    5. Next

    not working right thu :|

  8. #8
    -= B u g S l a y e r =- peet's Avatar
    Join Date
    Aug 2000
    Posts
    9,629
    now I'v tested it on 10000 itmes... still no boring action


    if u want to delete items, go through the list backwards... like this

    VB Code:
    1. Private Sub Command1_Click()
    2.     Dim i As Long
    3.     For i = List1.ListCount - 1 To 0 Step -1
    4.        If List1.Selected(i) Then List1.RemoveItem i
    5.     Next i
    6. End Sub
    -= a peet post =-

  9. #9

    Thread Starter
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729
    yes u right just some stupid supostion i made because i thought he would have to select each and every single line lol just forget it nvm

  10. #10
    -= B u g S l a y e r =- peet's Avatar
    Join Date
    Aug 2000
    Posts
    9,629
    ok

    did the delete routine work as u wanted it to ?
    -= a peet post =-

  11. #11

    Thread Starter
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729
    yessssss :-)

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