|
-
Feb 9th, 2006, 11:28 AM
#1
Thread Starter
Member
[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.
-
Feb 9th, 2006, 11:30 AM
#2
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
-
Feb 9th, 2006, 11:37 AM
#3
Thread Starter
Member
Re: ListBox - Showing bottom of list
-
Feb 9th, 2006, 12:52 PM
#4
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.
-
Feb 9th, 2006, 02:09 PM
#5
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
-
Feb 9th, 2006, 02:12 PM
#6
Hyperactive Member
Re: ListBox - Showing bottom of list
And another if you dont want to highlight the item
VB Code:
List1.TopIndex = List1.NewIndex
-
Feb 9th, 2006, 04:06 PM
#7
Addicted Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|