Results 1 to 5 of 5

Thread: easy listbox stuff

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Sep 2000
    Location
    Belfast
    Posts
    109

    easy listbox stuff

    Hi, Does anyone here now how to get the value of the second from last item in a listbox?
    Thanks in advance,
    John

  2. #2
    Addicted Member Hole-In-One's Avatar
    Join Date
    Mar 2003
    Location
    Minnesota
    Posts
    195
    Dim text as string

    text = listbox1.item(listbox1.items.count-2).text

    msgbox(text)


    No sure if this is completely right but it should be close
    (Dont have VS.Net on this computer)

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Sep 2000
    Location
    Belfast
    Posts
    109
    nope it doesn work

  4. #4
    Hyperactive Member sw_is_great's Avatar
    Join Date
    Nov 2003
    Posts
    330
    text = listbox1.item(listbox1.items.count-2)
    Regards

  5. #5
    Addicted Member Hole-In-One's Avatar
    Join Date
    Mar 2003
    Location
    Minnesota
    Posts
    195
    Try this:

    Dim text as string
    Dim i as integer=listbox1.items.count-2

    text = listbox1.item(i)

    msgbox(text)

    I was thinking Listview not Listbox

    Damn you be me to it!

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