[Gambas-user] extended Combobox

Karl Reinl karl.reinl at ...9...
Mon May 26 19:03:33 CEST 2014


Am Montag, den 26.05.2014, 09:52 -0500 schrieb Daniel Quintero:
> I use this code (Obviously, without creating a custom combo):
> 
> ' aIDs is an array of Integers, and you can assing that array to a Variant
> variable,
> ' as is the case of the Tag property of the combobox.
> 
> Public Sub LoadCombo()
> Dim aIDs As New Integer[]
> Dim sQuery As New String
> 
>   cboSample.Clear
> 
>   ' Load Data
>   hResult = $hConn.Exec("select ID, desc from MyTable")
>   For Each hResult
>     cboSample.Add(hResult!desc)
>     aIDs.Add(hResult!ID)
>   Next
>   cboSample.Tag = aIDs
> 
> End
> 
> Public Sub cboSample_Change()
>   If cboSample.Index > -1 Then
>     Message("ID associated with '" & cboSample.Text & "': " &
> cboSample.Tag[cboSample.Index])
>   Endif
> End
> 
> Regards
> 
> *_________________________*
> *Lic. Daniel Quintero Rojas*
> 
> *¡Saludos desde México!________*
> 
> 
> 
> On Sun, May 25, 2014 at 2:12 PM, Karl Reinl <karl.reinl at ...9...> wrote:
> 
> > Salut,
> >
> > I need an extended Combobox,
> > no sorry I would like to have an extended Combobox,
> > where I can add elements like
> > .Add(Item AS String[,key AS Variant]),
> > does anybody made that yet, and want to share ?
> >
> > --
> > Amicalement
> > Charlie
> >

Salut Daniel,

thanks for that code, I knew it because in a similar case you gave it to
the list
 
-- 
Amicalement
Charlie





More information about the User mailing list