Topic: Combobox Index Number
Hi,
A "new" ComboBox Index Question.
I have been struggled with this for while now. What i want to do is something like this.
When a user creates a new record i have a combobox in the form with different countries too choose from.
When someone fills in a Company name i check if there is an INI-file in that companys name.
If there is, a number of fields in the form if filled in automatically from the INI-file.
"
Adr := Form1.Edit3.Text;
If FileExists(IFile) Then
begin
ini := TIniFile.Create(ExtractFilePath(Application.ExeName)+ '\ini\'+ Adr + '.ini');
try
Form1.Edit8.Text := ini.ReadString('Settings', 'Typ', '');
-- A --> Str := ini.ReadString('Settings', 'Index', '');
-- B --> Form1.ComboBox1.ItemIndex := StrToInt(Str);
Form1.Edit7.Text := ini.ReadString('Settings', 'PG', '');
Form1.Edit6.Text := ini.ReadString('Settings', 'OCR', '');
"
In the form i got a function, that helps users to create the INI-file.
The user can choose a country from a ComboBox in the form, but i really want to store the index number in the INI-file so that the row
markt A and B above works.
Does anyone have a solution to how to easy find the Index of a value in a ComboBox.
Regards
Hedan