Re: Listbox scroll problem

Tech-Archive recommends: Fix windows errors by optimizing your registry




"Rick Rothstein (MVP - VB)" <rickNOSPAMnews@xxxxxxxxxxxxxxxxx> wrote in message
news:e4hTug0jHHA.504@xxxxxxxxxxxxxxxxxxxxxxx
I have a listbox which has items added to it progressively as user entry
progresses. Whenever it is full, the scroll bar appears as expected. However,
I have to operate the scroll bar to read the latest entry. How can I arrange
things so that the last entries are always showing, ie the early entries
disappear off the top (and can be brought back by scrolling if inspection is
needed)?

Whenever you want to place the selection on the last item of the ListBox,
simply execute this code...

List1.ListIndex = List1.ListCount - 1

Rick

Another way, if used right after adding an item, is to use the NewIndex
property:

List1.AddItem "sample item"
List1.ListIndex = List1.NewIndex


.



Relevant Pages

  • RE: Add / Remove Programs is BLANK!
    ... I do not have negative entries either. ... "Chad Parks" wrote: ... There is not a scroll bar either so it's not just blank ... > I'm running Windows XP w/SP2 included on the CD. ...
    (microsoft.public.windowsxp.general)
  • Re: Listbox scroll problem
    ... As I make various entries in a program, ... the scroll bar to see the latest. ... entry progresses. ... ListBox, simply execute this code... ...
    (microsoft.public.vb.general.discussion)
  • Re: Listbox scroll problem
    ... As I make various entries in a program, ... the scroll bar to see the latest. ... While you are correct for the OP's implied usage (non-sorted ListBox), ... the latest entry added to a ListBox with its Sorted property set to True ...
    (microsoft.public.vb.general.discussion)
  • Scroll Through Pivot Table Entries
    ... I have a pivot table chart. ... The chart is setup to show only one entry ... I have with many different entries, 197 total, in the ... Is there a way to create a scroll bar from the Forms toolbar and use ...
    (microsoft.public.excel.misc)
  • Re: Some info boxes too small to read all info
    ... scroll bar. ... resize the entries in the title bar to see long entries. ... they not provide a normal re-sizeable window? ...
    (microsoft.public.windowsxp.general)