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

timothy timothy.marshal-nichols at ...247...
Fri Jan 26 11:49:37 CET 2007


> -----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.

Thanks

8-{)} Timothy Marshal-Nichols
<mailto: timothy.marshal-nichols at ...247...>







More information about the User mailing list