-
Listbox Scroll
Hello and thanks in advance for any who respond to my question.
The default llistbox behavior seems to be to add a vertical scroll bar automatically whenever the number of items exceeds the listbox size.
This is fine, however I would like to see the most recently added element, which I can't do unless I manually scroll down.
Is there a way to automatically scroll down when a new item is added to the listbox?
-
Try this:
lstBox.AddItem "Item"
lstBox.ListIndex = lstBox.NewIndex
Phil Weber
http://www.philweber.com
Please post questions to the forums, where others may benefit.
I do not offer free assistance by e-mail. Thank you!
-
Thanks Phil. Is there any way to do this in the event that a new item is added? In other words, can I capture the event that something new was added to the listbox and then do list1.listendex = newindex?
finding every instance where I do list1.additem will be difficult as it is spread throughout the program in different modules. Thanks again.
-
I don't think adding an item raises an event. I would probably create a helper function to add an item and set the ListIndex, then do a search for AddItem and replace it with a call to the helper function.
Phil Weber
http://www.philweber.com
Please post questions to the forums, where others may benefit.
I do not offer free assistance by e-mail. Thank you!
-
OK will do. Thanks again.
Similar Threads
-
Replies: 0
Last Post: 07-06-2006, 09:47 AM
-
Replies: 1
Last Post: 06-12-2006, 07:34 PM
-
By demarie in forum ASP.NET
Replies: 0
Last Post: 04-19-2005, 04:26 PM
-
Replies: 3
Last Post: 08-30-2001, 11:45 AM
-
By Steve J Golem in forum VB Classic
Replies: 0
Last Post: 12-09-2000, 09:06 PM
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
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks