Results 1 to 12 of 12

Thread: ScrollBars in Listboxes

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2000
    Posts
    7
    Can anybody help me?

    I am trying to synchronise scrollbars in listboxes, i.e if one scrolls, the others should also scroll.

    The problem is that Listboxes do not have a scrollbar property/I don't know

    There is an event Scroll, but it does not return a value...

    PLEASE HELP!

  2. #2
    Fanatic Member kinjalgp's Avatar
    Join Date
    Apr 2000
    Location
    India
    Posts
    535

    Talking

    Scroll bars appears in the list box as soon as the list items increse than the size of the list box.
    So you don't have to make separate scrollbar for list box.


  3. #3

    Thread Starter
    New Member
    Join Date
    May 2000
    Posts
    7
    Thanks for the reply, but that is my problem:

    Here is what happens:

    Three lists grow at exactly the same pace.

    All get scroll bars at exactly the same time.

    Now, when I scroll in one list, I want the other two to scroll automatically.

    Any ideas?

  4. #4
    Fanatic Member kinjalgp's Avatar
    Join Date
    Apr 2000
    Location
    India
    Posts
    535

    Unhappy

    I think that's impossible?

    Sorry

  5. #5
    Fanatic Member
    Join Date
    Mar 2000
    Location
    That posh bit of England known as Buckinghamshire
    Posts
    658
    Can't seem to get the list boxs to scroll together, but this works if the user is using the cursor keys or the page up/down keys.

    Some API guru will probably be able to tell you how to do it.

    Code:
    Option Explicit
    
    Private Sub Form_Load()
        Dim i As Integer
        
        For i = 1 To 100
          List1.AddItem i
          List2.AddItem i
        Next i
        
        List1.ListIndex = 0
        List2.ListIndex = 0
        
    End Sub
    
    Private Sub List1_Click()
        List2.ListIndex = List1.ListIndex
    End Sub
    
    Private Sub List2_Click()
        List1.ListIndex = List2.ListIndex
    End Sub
    Iain, thats with an i by the way!

  6. #6

    Thread Starter
    New Member
    Join Date
    May 2000
    Posts
    7

    Unhappy

    Cheers for the attempt...

    Ill let you know if I solve it...

  7. #7
    Frenzied Member Mark Sreeves's Avatar
    Join Date
    Nov 1999
    Location
    UK
    Posts
    1,845
    Why do you need to use 3 syncronised list boxes?
    Can't you use a listview with 3 columns?
    Mark
    -------------------

  8. #8

    Thread Starter
    New Member
    Join Date
    May 2000
    Posts
    7
    Cheers

    I'll try it now...

  9. #9
    Addicted Member pardede's Avatar
    Join Date
    Jan 2000
    Posts
    232
    I think you can use the scroll event. Using something like:

    Code:
    Private Sub listbox1_Scroll()
       lisbox2.TopIndex = lisbox1.TopIndex 'or something
    End Sub
    [Edited by pardede on 05-16-2000 at 02:45 PM]

  10. #10
    Fanatic Member
    Join Date
    Mar 2000
    Location
    That posh bit of England known as Buckinghamshire
    Posts
    658
    Bollox, what a simple soultion. I stand humbled before Pardede's wisdom
    Iain, thats with an i by the way!

  11. #11

    Thread Starter
    New Member
    Join Date
    May 2000
    Posts
    7
    Thanks a mil

  12. #12
    Addicted Member pardede's Avatar
    Join Date
    Jan 2000
    Posts
    232

    Talking

    ............
    No problem, me just glad my peace of thought has some meaning
    ............


    ______________________________________________________
    ...scroll-scroll-scroll the bar gently down the box..

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