Results 1 to 6 of 6

Thread: scroll two listboxes?

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2000
    Location
    Lansing, MI
    Posts
    7
    Is there a way to scroll 2 listboxes at the same time to keep the items aligned? The listboxes will always have the same number of items. For example, when listbox1 is scrolled, listbox2 scrolls along with it and vice-versa. Thanks for your help!

    -Gabe

  2. #2
    Fanatic Member wildcat_2000's Avatar
    Join Date
    Nov 2000
    Location
    Italy
    Posts
    727
    Basically you could set the scrollbar.value of textbox2 to the same value of the scrollbar.value of textbox1 when the mouseover occurs.

  3. #3

    Thread Starter
    New Member
    Join Date
    Oct 2000
    Location
    Lansing, MI
    Posts
    7
    Listboxes don't have a scroll property, just a scroll event. (or do they?) None that I can find anyway... Would this be an API issue?

  4. #4
    Guest
    Code:
    Private Sub List1_Click()
    List2.ListIndex = List1.ListIndex
    End Sub
    
    Private Sub List2_Click()
    List1.ListIndex = List2.ListIndex
    End Sub

  5. #5

    Thread Starter
    New Member
    Join Date
    Oct 2000
    Location
    Lansing, MI
    Posts
    7
    Thanks for the replies. I am already using the index number to keep corresponding items selected between the two listboxes. However, I would like to keep the selected items aligned as well so when the user scrolls in one listbox the corresponding selected item the other will scroll and remain horizontially aligned. In simpler terms, when one listbox scrolls, the other scrolls with it. Thanks again for any help.

  6. #6
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>

    this is all you need...
    Code:
    Private Sub list1_scroll()
      List2.TopIndex = List1.TopIndex
    End Sub
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

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