473,471 Members | 1,684 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Vb6 Listbox scroll to last entry

104 New Member
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
5 12750
debasisdas
8,127 Recognized Expert Expert
Have you tried to set the listindex =listcount-1 ?
Feb 11 '08 #2
Wernerh
104 New Member
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
8,127 Recognized Expert Expert
Use this

Expand|Select|Wrap|Line Numbers
  1. List1.ListIndex = List1.ListCount - 1
  2.  
Feb 11 '08 #4
Wernerh
104 New Member
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
137 New Member
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

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

Similar topics

4
by: Filips Benoit | last post by:
Dear All, I have code that selects - find and select - 1 item in a large listbox. This works Ok but most of the time the selected item isn't visible without scrolling down manualy. Is this...
6
by: Adam Klobukowski | last post by:
Hello. /windows forms/ I'm marking listbox items as selected, and I'd like to scroll listbox to a selected entry if it is off-screen. How can I do it? -- Semper Fidelis Adam Klobukowski
1
by: Daniel | last post by:
hi, I had an asp:listbox, and everytime i click item inside, the bar automatically go to the top, is there any way to keep the scroll position? I turn on the smartNavigation, it still doesn't...
3
by: Thunder$truck | last post by:
I'm sure this is easy but I can't figure it out. I use a ListBox for my application log and each time the app performs a task an entry is added into the ListBox. When the list box becomes...
5
by: John Veldthuis | last post by:
My code works perfectly 100% when adding items to my ArrayList and updating the listbox. Works perfectly when deleting an item in the ArrayList when it is not the last entry but if it is the last...
2
by: John | last post by:
Hi, I'm currently working on a simple project (for study on C#) with an input (maskedtextbox) and a listbox. The input numbers are send in the listbox. When the listbox is filled with numbers...
3
by: superjacent | last post by:
Hope someone can help. I have a listbox displaying time periods in blocks of 15 mins for a 24 hour period, all up 96 rows. The listbox can only visibly show 20 rows a time. The default...
5
by: Matthew Wells | last post by:
I have a listbox set to simple multi select. For this example, users only select one item at a time. I have command buttons on the form for First, Previous, Next, Last, New (record). The form...
7
by: Lit | last post by:
Hi, How can I capture the vertical scroll bar position for a Listbox. I have a Listbox of 100 items + when I click on it I post back remove the item selected. After returning to the client...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.