Results 1 to 9 of 9

Thread: ListView

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Aug 2000
    Location
    I'm right here!
    Posts
    849

    ListView

    How can I know the text in a column of a list?
    Dekel C.

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333
    VB Code:
    1. MsgBox ListView1.SelectedItem.Text

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Aug 2000
    Location
    I'm right here!
    Posts
    849
    But what if I need to combine the text of two columns? (I have four)
    Dekel C.

  4. #4
    Hyperactive Member
    Join Date
    May 2001
    Location
    England
    Posts
    312
    Code:
    MsgBox ListView1.SelectedItem.Text & ListView2.SelectedItem.Text
    Power to 2000 Electronic Donkeys!
    www.edonkey2000.com
    I hate case sensitivity... all you get down the M1 is "are we there yet" and "ouch, watch the bumps".

  5. #5

    Thread Starter
    Fanatic Member
    Join Date
    Aug 2000
    Location
    I'm right here!
    Posts
    849
    I meant two colomns in one ListView....
    Dekel C.

  6. #6
    Addicted Member
    Join Date
    Mar 2001
    Location
    Anywhere
    Posts
    136

    this is how

    For Each ListItemX In ListView1.ListItems
    If ListItemX.Selected = True Then
    ListItemX.SubItems(ListView1.ColumnHeaders("Code").SubItemIndex)
    End If
    Next ListItemX

  7. #7
    Hyperactive Member
    Join Date
    May 2001
    Location
    England
    Posts
    312
    sorry, i misunderstodd!
    Power to 2000 Electronic Donkeys!
    www.edonkey2000.com
    I hate case sensitivity... all you get down the M1 is "are we there yet" and "ouch, watch the bumps".

  8. #8

    Thread Starter
    Fanatic Member
    Join Date
    Aug 2000
    Location
    I'm right here!
    Posts
    849
    I don't understand what you wrote...
    What variable is the two texts from the listview1?
    Dekel C.

  9. #9
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256
    VB Code:
    1. ListView1.SelectedItem.Text

    Will give you the 1st columns text of the selected item.

    VB Code:
    1. ListView1.SelectedItem.ListSubItems(1).Text

    Will give you the 2nd columns text of the selected item.

    VB Code:
    1. ListView1.SelectedItem.ListSubItems(2).Text

    Will give you the 3rd columns text of the selected item.
    My evil laugh has a squeak in it.

    kristopherwilson.com

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