Results 1 to 6 of 6

Thread: ListBox ** Resolved **

  1. #1

    Thread Starter
    Fanatic Member vb_dba's Avatar
    Join Date
    Jun 2001
    Location
    Somewhere aloft between the real world and insanity
    Posts
    1,016

    ListBox ** Resolved **

    I have a form that has two list boxes. One form contains a list of servers while the other contains a list of services. When they are populated the data syncs up like:

    Server Service
    Serv-01 IIS Admin
    Serv-01 MSSQLServer
    Serv-02 Logical Disk Manager
    Serv-02 IIS Admin

    I want to make it so that when scroll down in one list box, the other scrolls down as well. That way my server and service stay linked up. Is this possible?

    Chris
    Last edited by vb_dba; Sep 27th, 2001 at 02:06 PM.
    Chris

    Master Of My Domain
    Got A Question? Look Here First

  2. #2
    Hyperactive Member
    Join Date
    Jan 2000
    Location
    Edinburgh, Scotland
    Posts
    272
    Try this:
    VB Code:
    1. Private Sub List1_Click()
    2.     List2.ListIndex = List1.ListIndex
    3. End Sub

  3. #3
    Frenzied Member vbgladiator's Avatar
    Join Date
    May 2001
    Posts
    1,950
    or when you're scrolling do this:

    list2.listindex = list1.topindex

  4. #4

    Thread Starter
    Fanatic Member vb_dba's Avatar
    Join Date
    Jun 2001
    Location
    Somewhere aloft between the real world and insanity
    Posts
    1,016
    That works okay, but I want both list boxes to scroll when I click the scroll bar on either.

    I just found where you can make a list box have multiple columns. How do I add values to those columns? This might be a simpler solution to what I'm looking for.
    Chris

    Master Of My Domain
    Got A Question? Look Here First

  5. #5
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333
    Why don't you load both of your columns into a ListView control instead of a Listbox. That would give you a lot functionality.

  6. #6

    Thread Starter
    Fanatic Member vb_dba's Avatar
    Join Date
    Jun 2001
    Location
    Somewhere aloft between the real world and insanity
    Posts
    1,016
    I modified vbgladiators suggestion to read list2.TopIndex = list1.TopIndex and it works perfect. Thanks to all for all of your responses.

    Chris
    Chris

    Master Of My Domain
    Got A Question? Look Here First

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