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

Stefano Palmeri rospolosco at ...152...
Mon Jan 29 10:17:49 CET 2007


Alle 09:41, lunedì 29 gennaio 2007, timothy ha scritto:
> > 
> > Hi. The only way seems to be adding the last item on top of the
> listbox.
> > Try the attached example (Gambas 1.9.47)
> > 
> > Ciao.
> > 
> 
> 1) Adding an item to at the end of the list does work:
> 
>  ListBoxLog.Add("New Item")
>  ListBoxLog.Index = ListBoxLog.Count - 1
> 
> 
> 2) There is a simpler way of adding an item at the top of a list than
> your example. The Add method takes an optional Index parameter. So you
> could use:
> 
>  ListBoxLog.Add("New Item", 0)
>  ListBoxLog.Index = 0
> 
> To add the item at the top of the list and ensure it is visible.
> 
> Thanks
> 

Yes. Till now I didn't know about ListBox.Index. It's very useful, but it is 
not explained in the Help (1.9.47). I'm a pure hobbist totally Gambas (never 
programmed in VB) programmer and I lack a lot of info. Thanks for showing
the use of ListBox.Index.

Regards,

Stefano Palmeri




> 8-{)} Timothy Marshal-Nichols
> <mailto: timothy.marshal-nichols at ...247...>
> 
> 
> 
> 
> 
> -------------------------------------------------------------------------
> 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