[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.
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:
Private intListBottom As Integer
Private Sub Command1_Click()
intListBottom = List1.ListCount
List1.AddItem "Basman"
List1.ListIndex = intListBottom
End Sub
Re: ListBox - Showing bottom of list
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. :)
Re: ListBox - Showing bottom of list
Another method is to use the NewIndex property
VB Code:
Private Sub Command1_Click()
List1.AddItem "Basman"
List1.ListIndex = List1.NewIndex
End Sub
Re: ListBox - Showing bottom of list
And another if you dont want to highlight the item
VB Code:
List1.TopIndex = List1.NewIndex
Re: ListBox - Showing bottom of list
I do suggest to resolve it..