[Gambas-user] Obtaining the contents of a particular Listbox index
Michael Sullivan
michael at ...558...
Thu Aug 19 16:55:44 CEST 2004
I apologize. I was writing my email at the time when your post came
into my InBox. Here's the situation: I'm still writing my TODO list
GUI interface. I have three Listboxes: one for Tasks, one for the date
a task was entered (String) and one for the current status of the task.
They are all linked together (if you select a particular item in one
list box, the same index in the other two are selected) I have a combo
box with possible actions to perform on a particular task and a Button
to commit the action selected. The first option in the Action combo is
to Change Status (right now 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 I try I get an error and everything I can find in the help
says that the listbox is a read-only array and I can't figure out how to
change it.
On Thu, 2004-08-19 at 09:36, Hans-Martin Bundeshund wrote:
> Michael Sullivan <michael at ...558...> wrote:
>
> >How do I obtain and change the contents of the
> >currently selected item
> >in a Listbox?
>
> E.G. if You have a Button called 'Button1' for
> finishing the selection in your Listbox, called
> 'ListBox1' (with Mode=Extended), you can use something
> like this spagetti-code:
>
>
>
> PUBLIC SUB Button1_Click()
> z as Integer
>
>
> IF NOT ListBox1.Current THEN
> message.Info("Please select an entry first")
> ELSE
> FOR z=0 TO ListBox1.Count-1
> IF AuswahlListBox[z].Selected THEN
> AuswahlListBox.Index = z
> Message.Info("You selected: " & ListBox1.Text)
> ENDIF
> NEXT
> ENDIF
>
> END
>
>
>
> If Your Listbox is running in single-mode, than you
> only have to use 'TextBox1.Text' (or what propertie
> you need).
>
> HTH
>
> HM
>
>
>
>
>
>
> ___________________________________________________________
> Gesendet von Yahoo! Mail - Jetzt mit 100MB Speicher kostenlos - Hier anmelden: http://mail.yahoo.de
>
>
> -------------------------------------------------------
> 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