Results 1 to 7 of 7

Thread: [RESOLVED] ListBox - Showing bottom of list

  1. #1

    Thread Starter
    Member
    Join Date
    Dec 2001
    Posts
    48

    Resolved [RESOLVED] ListBox - Showing bottom of list

    I am using a list box to show files I am processing one at a time.

    This list is long so that the list box ends up having a scroll bar.

    Every time a new line gets added to the end of the list box entries, the scroll bar ends back up at the top of the list.

    How do I add a line and have the box display the bottom of the list so i don't keep having to rescroll down to the bottom while it's off processing a file.

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: ListBox - Showing bottom of list

    Get the count of the total number of items in the listbox, and set its ListIndex to that number. Something like
    VB Code:
    1. Private intListBottom As Integer
    2.  
    3. Private Sub Command1_Click()
    4. intListBottom = List1.ListCount
    5. List1.AddItem "Basman"
    6. List1.ListIndex = intListBottom
    7. End Sub

  3. #3

    Thread Starter
    Member
    Join Date
    Dec 2001
    Posts
    48

    Re: ListBox - Showing bottom of list

    Thanks !!!

  4. #4
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: ListBox - Showing bottom of list

    No problem. If this is resolved, could you pull down the Thread Tools menu and click on Mark This Thread Resolved.

    This will let everyone know you have your answer.

    Thanks.

  5. #5
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758

    Re: ListBox - Showing bottom of list

    Another method is to use the NewIndex property

    VB Code:
    1. Private Sub Command1_Click()
    2.    List1.AddItem "Basman"
    3.    List1.ListIndex = List1.NewIndex
    4. End Sub

  6. #6
    Hyperactive Member
    Join Date
    Mar 2005
    Posts
    499

    Re: ListBox - Showing bottom of list

    And another if you dont want to highlight the item
    VB Code:
    1. List1.TopIndex = List1.NewIndex

  7. #7
    Addicted Member
    Join Date
    Feb 2006
    Posts
    129

    Re: ListBox - Showing bottom of list

    I do suggest to resolve it..

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