Re: Listbox scroll problem
- From: "BeastFish" <no@xxxxxxxx>
- Date: Sat, 5 May 2007 19:26:30 -0400
List1.AddItem Text1.Text
List1.TopIndex = List1.NewIndex
Is this what you want?
"Gingre" <not@xxxxxxxx> wrote in message news:463ce4b8@xxxxxxxxxxxxxxxxxxxx
I suspect this has missed the point, owing to my incompetence atexplaining
it... I'll try again.visible,
As I make various entries in a program (in text boxes), I use the code...
List1.AddItem Text1.Text
As the entries proceed, the list box fills up. When it is full the scroll
bar appears, but I continue to see only the first entries, and have to use
the scroll bar to see the latest.
I want to have it the other way: I want the latest items to remain
while the earlier ones "fall out of" the list box and must be brought backlatest
with the scroll bar.
"Rick Rothstein (MVP - VB)" <rickNOSPAMnews@xxxxxxxxxxxxxxxxx> wrote in
message news:%23gzMP00jHHA.5048@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
broughtentry. How can I arrange things so that the last entries are always
showing, ie the early entries disappear off the top (and can be
theback 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
While you are correct for the OP's implied usage (non-sorted ListBox),
real strength of the NewIndex property is for when you want to identify
the latest entry added to a ListBox with its Sorted property set to True
(you wouldn't know the ListIndex value for the item in this case).
Rick
.
- References:
- Listbox scroll problem
- From: Gingre
- Re: Listbox scroll problem
- From: Rick Rothstein \(MVP - VB\)
- Re: Listbox scroll problem
- From: Steve Gerrard
- Re: Listbox scroll problem
- From: Rick Rothstein \(MVP - VB\)
- Re: Listbox scroll problem
- From: Gingre
- Listbox scroll problem
- Prev by Date: Re: Does the VB6 CommonDialog work (compiled on Win98se) work on Vista
- Next by Date: Re: REGSVR32 not finding dll in current folder
- Previous by thread: Re: Listbox scroll problem
- Next by thread: Re: Listbox scroll problem
- Index(es):
Relevant Pages
|