[Gambas-user] Obtaining the contents of a particular Listbox index

Michael Sullivan michael at ...558...
Thu Aug 19 21:58:31 CEST 2004


Thank you.  That answers my question perfectly.  I would have never
thought of using Listbox.Current as an object and putting another method
after it.  That should be in the help/documentation.

On Thu, 2004-08-19 at 12:27, Rob wrote:
> On Thursday 19 August 2004 10:55, Michael Sullivan wrote:
> > status is either "Not Started" or "In Progress".  I need to be
> > able to change the text of the currently selected item in
> > lstStatus from "Not Started" to "In Progress", but every time
> 
> Here's some code that fills a listbox named ListBox1 with A to Z, 
> and then when you click on an entry in the listbox it toggles it 
> from being in parens to not.  You should be able to derive how 
> to make this work with lstStatus in your project based on input 
> from somewhere else besides its click event.
> 
> Rob
> 
> PUBLIC SUB Form_Open()
> 
>   DIM i AS Integer
>   FOR i = 1 TO 26
>     listbox1.Add(Chr(i + 64))
>   NEXT
> 
> END
> 
> PUBLIC SUB ListBox1_Click()
> 
>   IF Left(listbox1.current.Text,1) = "(" THEN
>     listbox1.current.Text = Mid(listbox1.current.Text,2,1)
>   ELSE
>     listbox1.current.Text = "(" & listbox1.current.Text & ")"
>   ENDIF
> 
> END
> 
> 
> 
> 
> -------------------------------------------------------
> SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media
> 100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33
> Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift.
> http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285
> _______________________________________________
> 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