[Gambas-user] extended Combobox

Rolf-Werner Eilert eilert-sprachen at ...221...
Tue May 27 12:14:27 CEST 2014



Am 26.05.2014 11:50, schrieb Benoît Minisini:
> Le 25/05/2014 23:48, Christof Thalhofer a écrit :
>> Hi,
>>
>> Am 25.05.2014 21:12, schrieb Karl Reinl:
>>
>>> 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 ?
>>
>> Funny. I started working with Gambas a week ago and saw, that the
>> existing ComboBox does not match my requirements. So I started to write
>> my own. It's not complete yet, but seems to become quite good and aims
>> to reproduce the behaviour of the MS Access Combobox.
>>
>> One can fill it with the content of a table (rows, columns), decide,
>> which columns are displayed, one column can contain a index which the
>> ComboBox spits out in any way (for example for a db primary key – not
>> ready, and for me that feature is in question for now).
>
> There is a "DataComboBox" in gb.db.form that does that more or less. But
> I admit there is no a "ComboBox with a key".
>
> Maybe I should implement it, as many lazy :-) old VB users ask for that.
>
> Regards,
>

When you let the Combobox sort its contents, and the items shown differ 
from what your database/code holds, you will lose reference to your 
items. As long as there is no way of keeping a reference to each item by 
some kind of key, you will have to sort the data beforehand and feed the 
combobox with them in the same order.

The same is true for any listbox etc.

Rolf




More information about the User mailing list