title: How could i set Delphi combobox current itemindex using IndexOfObject method with object info
body: <p>I filled TStringList object as below:</p>
  
  <pre><code>var
  infoObject: TStringObject;
  dataObject: TStringList
  
  _query.First;
  for i := 0 to _query.RecordCount-1 do
  begin
    infoObject := TStringObject.Create;
    infoObject.stringsData.Add(_query.Fields[0].AsString);
    dataObject.AddObject(_query.Fields[1].AsString, infoObject);
  
    _query.Next;
  end;
  </code></pre>
  
  <p>and then use it to populate comboBox like this:</p>
  
  <pre><code>combo1.Items.Clear;
  combo1.Items.AddStrings(dataObject);
  </code></pre>
  
  <p>Now I wat to set comboBox itemIndex with equal string value from DB. I know in routine scenario when I have text that show in comboBox az text use IndexOf will help me like this:</p>
  
  <pre><code>combo1.ItemIndex := combo1.Items.IndexOf('[text of item]');
  </code></pre>
  
  <p>but I want to set it with value exist in object and not Text. I see IndexOfObject method but it can't work as IndexOf or I don't know how should be use it.I write this lines but it not work:</p>
  
  <pre><code>itemObject := TStringObject.Create;
  itemObject.stringsData.Add('[value of item]');
  combo1.ItemIndex := combo1.Items.IndexOfObject(itemObject);
  </code></pre>
  
  <p>Can anyone help? Should mention I'm using Delphi 2007 and Raize Componenet ComboBox.</p>