[Gambas-user] Re: Combo Box Question
Maurice Dumais
mdumm at ...647...
Thu Nov 4 18:46:10 CET 2004
Hi Ronan,
I had this problem with a listbox, and I did a little "hacking" as follows:
while r.available
listbox1.Add(r["name"] & String$(30," ") & r["id"])
r.movenext
wend
The table id is embedded in the same string as the name
with a space padding
This way the (id) does not show in the listbox window.
To extract the (id) from the selected listbox item
PUBLIC SUB listbox1_Click()
Dim sID as String
Dim recID as Integer
sID=listbox1[listbox1.Index].Text
recID=CInt(Right$(sID,6))
.......
END
It might not be elegant, but it serves my purpose.
Maurice
More information about the User
mailing list