[Gambas-user] extended Combobox

Daniel Quintero dquinter at ...626...
Mon May 26 16:52:53 CEST 2014


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
>
>
>
> ------------------------------------------------------------------------------
> "Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
> Instantly run your Selenium tests across 300+ browser/OS combos.
> Get unparalleled scalability from the best Selenium testing platform
> available
> Simple to use. Nothing to install. Get started now for free."
> http://p.sf.net/sfu/SauceLabs
> _______________________________________________
> 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