Search code examples
delphitcomboboxrad-studio

Get selected value of TCombobox in Delphi RAD Studio 10


How to get the selected value from a TComboBox?

The TCombobox name is comboTest

vaue_is := comboTest ???

Solution

  • You can use ItemIndex:

    if comboTest.ItemIndex >= 0 then
      vaue_is := comboTest.Items[comboTest.ItemIndex];
    

    This should work equally well for VCL and FireMonkey (FMX).