By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,512 Members | 3,520 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,512 IT Pros & Developers. It's quick & easy.

Vb6 Listbox scroll to last entry

100+
P: 104
Hi, I have created a log in a listbox to show users everytime someone has logged on. Is there a form load function that will scroll down the listbox to the last entry each time the form is loaded??

Thanks
Feb 11 '08 #1
Share this Question
Share on Google+
5 Replies


debasisdas
Expert 5K+
P: 8,127
Have you tried to set the listindex =listcount-1 ?
Feb 11 '08 #2

100+
P: 104
Have you tried to set the listindex =listcount-1 ?
Hi just tried this code :

List2.ListIndex = ListCount - 1

No luck unfortunately
Feb 11 '08 #3

debasisdas
Expert 5K+
P: 8,127
Use this

Expand|Select|Wrap|Line Numbers
  1. List1.ListIndex = List1.ListCount - 1
  2.  
Feb 11 '08 #4

100+
P: 104
Use this

Expand|Select|Wrap|Line Numbers
  1. List1.ListIndex = List1.ListCount - 1
  2.  
Thank you so much for your help - it now works
Feb 11 '08 #5

devonknows
100+
P: 137
Use this

Expand|Select|Wrap|Line Numbers
  1. List1.ListIndex = List1.ListCount - 1
  2.  
If i may, Just adding alittle error checking on that

Expand|Select|Wrap|Line Numbers
  1. If List1.Listcount > 0 then List1.Listindex = List1.Listcount - 1
  2.  
Stop any errors being triggered on the unlikely event that the Listbox is cleared, or items are removed.

Kind Regards
Devon
Feb 11 '08 #6

Post your reply

Sign in to post your reply or Sign up for a free account.