[Gambas-user] ListBox, how to auto-follow last added item.?

Fabien Bodard gambas.fr at ...626...
Fri Jan 26 15:15:35 CET 2007


PUBLIC SUB Button1_Click()

DIM i AS Integer

FOR i = 0 TO 100

ListBox1.Add(I)
ListBox1.Index = i
NEXT


END

2007/1/26, Jose J. Rodriguez <joe1962 at ...626...>:
>
> On 1/26/07, timothy <timothy.marshal-nichols at ...247...> wrote:
> >
> > > -----Original Message-----
> > > From: gambas-user-bounces at lists.sourceforge.net [mailto:gambas-user-
> > > bounces at lists.sourceforge.net] On Behalf Of Jose J. Rodriguez
> > > Sent: Thursday, 25 January 2007 10:30 PM
> > > To: mailing list for gambas users
> > > Subject: [Gambas-user] ListBox, how to auto-follow last added item.?
> > >
> > > I can't figure out any way to use the ListBox as a data logger, that
> > > is to "follow" the last added item and auto scrolling to keep it in
> > > sight. Is it at all possible? If not, this would be a very useful
> > > addition to it, IMHO. At least I use this kind of thing a lot in my
> > > aplications.
> > >
> > > Tried Listbox.Index = Listbox.Count - 1, from something I found
> > > searching the list, but no luck. Then went over the docs again,
> > > searched on the Forums, etc, and tried a lot of possibles and even
> > > some not so likely looking methods.... :(
> > >
> > > Regards,
> > > Joe1962
> > >
> >
> > Hello,
> >
> >         ListBoxLog.Index = ListBoxLog.Count - 1
> >
> > works for me.
> >
> > However if you are inside some long running event then the screen may
> > not be updated. Try adding a WAIT after setting the index.
> >
> >         ListBoxLog.Add("New Item")
> >         ListBoxLog.Index = ListBoxLog.Count - 1
> >         WAIT
> >
> > So screen update events are processed.
> >
>
>
> Well, today it works, no idea what I did last night, but that just
> goes to show you, don't program at night without having slept well the
> previous night. Thanks for the help Stefano and Timothy and sorry for
> the wild goose chase.
>
> Regards,
> Joe1962
>
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share
> your
> opinions on IT & business topics through brief surveys - and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>



More information about the User mailing list