I have the next TWebComboBox configuration in dfm.
object ComboBoxCD_COUNTRY: TWebComboBox
Left = 100
Top = 118
Width = 145
Height = 26
ElementClassName = 'form-select'
ElementID = 'ComboBoxCD_COUNTRY'
ElementFont = efCSS
HeightStyle = ssAuto
HeightPercent = 100.000000000000000000
Text = 'ComboBoxCD_COUNTRY'
WidthPercent = 100.000000000000000000
ItemIndex = -1
end
I assign his values like this:
ComboBoxCD_COUNTRY.Items.Add('United States=USA');
ComboBoxCD_COUNTRY.Items.Add('Canada=CAN');
ComboBoxCD_COUNTRY.Items.Add('Australia=AUS');
ComboBoxCD_COUNTRY.Items.Add('Brazil=BRA');
Now I retrieve the current country value from DB, such as 'AUS'.
I want the ComboBox to show the value 'Australia' as the selected one.
But the ItemIndex property in ComboBox has the complete strings assigned; because of it, the next sentence does nothing;
ComboBoxCD_COUNTRY.ItemIndex := ComboBoxCD_COUNTRY.Items.IndexOf('AUS');
To select the value I need to do this:
ComboBoxCD_COUNTRY.ItemIndex := ComboBoxCD_COUNTRY.Items.IndexOf('Australia=AUS');
How can I select the Correct ItemIndex using only the value 'AUS' (example)?