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

Jose J. Rodriguez joe1962 at ...626...
Fri Jan 26 14:04:01 CET 2007


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




More information about the User mailing list