TDBLookupListbox(Solved) lazarus / 31-LCL ---------------------------------------------------------------------- allanregistos · 2014-08-11 01:59 Hi, Probably a very noob or stupid question. But I have a hard time knowing how to exactly get/extract the selected item in a Listbox (TDBLookupListbox). Here is the Delphi equivalent: http://docwiki.embarcadero.com/Libraries/XE3/en/Vcl.DBCtrls.TDBLookupL istBox.SelectedItem Code: [Select]MyVar := MyListbox.SelectedItemSo simple and obvious. In Lazarus, there is no such a thing as SelectedItem property. This roadblock wasted so much time on my part, so anyone please help. Thanks, Allan ---------------------------------------------------------------------- fpcoder · 2014-08-11 02:21 Use ItemIndex, it returns the index of the selected item: Code: [Select]MyVar := MyDBListbox.Items[MyDBListbox.ItemIndex]; ---------------------------------------------------------------------- allanregistos · 2014-08-11 02:29 Quote from: kapibara on August 11, 2014, 04:21:56 amUse ItemIndex, it returns the index of the selected item: Code: [Select]MyVar := MyDBListbox.Items[MyDBListbox.ItemIndex];Thank you, thank you, thank you kapibara... You save my day.  Obviously, the code: MyListbox.Items[MyListbox.ItemIndex] is not obvious to me because the intellisense only provides this hint: Items:TString, not Items[Indexhere]. I relied heavily on intellisense for hints. This thread should be marked as Solved. Regards, Allan