Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 4 of 4 total
Thread Is it possible to hide the value part on a TEditComboBox?
Mon, Feb 20 2017 4:12 PMPermanent Link

Mario Enríquez

Open Consult

Hi folks,

I just feed a Name=Value strings to a TEditComboBox, but the value part is showing (please attached image). Is there a way to hide the value part and just show the name part?

Regards,
Mario



Attachments: ComboValues.jpg
Mon, Feb 20 2017 4:52 PMPermanent Link

Uli Becker

Mario,

> I just feed a Name=Value strings to a TEditComboBox, but the value part is showing (please attached image). Is there a way to hide the value part and just show the name part?

Since "AddObject" doesn't exist in EWB (I remember Tim announcing it for
a future version) I'd suggest to create a TStringList. Just populate the
items of the combobox with the Name- and the stringlist with the
Value-strings.
Thus you can use the combobox.itemindex to find the matching value in
the stringlist.

Uli
Mon, Feb 20 2017 5:47 PMPermanent Link

Mario Enríquez

Open Consult

Thank you Uli, simple and effective!

Regards,
Mario
Tue, Feb 21 2017 4:03 AMPermanent Link

Matthew Jones

Uli Becker wrote:

> create a TStringList

Or a TObjectList if you have something more to store. The complication comes when you have sorting, but even that is not too much effort in a backing list.

--

Matthew Jones
Image