Results 1 to 6 of 6

Thread: Listview - get text of selected subview

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2003
    Posts
    2

    Listview - get text of selected subview

    Hi all, i'm a newbie here and i'm looking for some help.

    This is my problem. I am looking for a way to return the text of a subitem when i select a row in a listview.

    What i am actually trying to achive is...
    I have a database of Music Albums. This database is loaded into a listview with the following columns (DiscNo,ArtsistName,AlbumName,Length). I want to select a row and from that row i would like to get the AlbumName and then load an image of the AlbumCover using the Album Name.

    Any help would be much appreciated, even a push in the right direction as i would like to figure this out form myself...

    Again Tanx in advance.

    Gottcha

    P.S
    I have a good (but not great) knowledge of VB.

  2. #2

  3. #3
    Where x is either the listsubitem key or Index of the column and the variable is the storage medium for the text ie Album Name.

    VB Code:
    1. Private Sub ListView1_ItemClick(ByVal Item As MSComctlLib.ListItem)
    2.  
    3.     Variable = Item.ListSubItems(x).Text
    4. End Sub

  4. #4

    Thread Starter
    New Member
    Join Date
    Nov 2003
    Posts
    2
    Got it sorted thanx to Ghost_Inside....
    Had something along that lines - missing the..
    ...ItemClick(ByVal Item As MSComctlLib.ListItem) code.


    Wokawidget i got a 'Method or member data not found' error on the subitem() method.

    I made a little change to the code based on Ghost_Inside's code... and it worked fine then.

    MsgBox ListView1.SelectedItem.ListSubItems(2).Text

    Thanx for both your help and I look forward to getting help from you in the future...

    Gottcha

  5. #5

  6. #6

    Glad to Help

    No problem ...glad to of helped

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