Results 1 to 3 of 3

Thread: Listview??!

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Aug 2006
    Posts
    249

    Unhappy Listview??!

    Okay, how do i make it so that i have to listviews (with items in them) and when i select an item in listview2 then the same item is highlighted/selected in listview1? How do i do this...Please Help! Thanks - All code is welcome.

  2. #2
    Next Of Kin baja_yu's Avatar
    Join Date
    Aug 2002
    Location
    /dev/root
    Posts
    5,989

    Re: Listview??!

    Search the forums for "synchronise listview" or "synchronised list" or something like that, there should be plenty of examples. Also check out the CodeBank section.

  3. #3
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: Listview??!

    If both listviews have the same items, then...
    Code:
    Set ListView1.SelectedItem = ListView1.FindItem(ListView2.SelectedItem.Text, lvwText)
    If Not ListView1.SelectedItem Is Nothing Then ListView1.SelectedItem.EnsureVisible
    Edited: If the listview items in both listviews have the same Keys
    Code:
    Set ListView1.SelectedItem = ListView1.ListItems(ListView2.SelectedItem.Key)
    ListView1.SelectedItem.EnsureVisible
    Last edited by LaVolpe; May 18th, 2010 at 02:41 PM.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

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