Page 1 of 1 1
Topic Options
#90861 - 2003-01-07 07:52 PM KixForms - ListBox
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
I am using AddItem to a ListBox and as I noticed that as items are added, it doesn't scroll to the last item.

Is there a property or something to keep the 'focus' on the last item in the list...

Specifically, In McAfeeManager, the bottommost text box that I used as a Status indicator, I've changed to a Listbox and tripled its height. The items are adding to the list fine, but you have to continously scroll down to see the newest items.
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#90862 - 2003-01-07 08:01 PM Re: KixForms - ListBox
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
$listbox.listindex=-1

or:
$listbox.listindex=$listbox.listcount

don't remember... check out.

[Smile]
_________________________
!

download KiXnet

Top
#90863 - 2003-01-07 08:07 PM Re: KixForms - ListBox
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
nope...

neither
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#90864 - 2003-01-07 08:21 PM Re: KixForms - ListBox
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Jooel is spot on except that ListIndex is a zero-based and starts at zero and ListCount starts at the number one. This gotcha got me as well (lol) ... so whats happening is that you add the first item and its ListIndex is zero - but the ListCount is one (there is no index one yet) - and it keeps on going like this never being able to select that last added entry. Bottom line is that you have to substract one from the ListCount value like this:

$ListBox.ListIndex = $ListBox.ListCount-1

-Shawn

Top
#90865 - 2003-01-07 08:26 PM Re: KixForms - ListBox
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
cool.. Thanks all
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
Page 1 of 1 1


Moderator:  Shawn, ShaneEP, Ruud van Velsen, Arend_, Jochen, Radimus, Glenn Barnas, Allen, Mart 
Hop to:
Shout Box

Who's Online
1 registered (Allen) and 781 anonymous users online.
Newest Members
Sir_Barrington, batdk82, StuTheCoder, M_Moore, BeeEm
17886 Registered Users

Generated in 0.053 seconds in which 0.024 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org