title: How to find the item by assigned object in TComboBox in Lazarus?
body: <p>How to find the item by assigned object in TComboBox ?</p>
  
  <p>I have a combo box, where I'm storing values from database; name as item and ID (integer) as an object:</p>
  
  <pre><code>ComboBox1.Clear;
  
  while not SQLQuery1.EOF do    
  begin    
    ComboBox1.AddItem(SQLQuery1.FieldByName('NAME').AsString, 
      TObject(SQLQuery1.FieldByName('ID').AsInteger));    
    SQLQuery1.Next;    
  end;
  </code></pre>
  
  <p>Assume, I have the following items in combo box:</p>
  
  <pre><code>Index    Item        Object
  ----------------------------
      0    'Dan'       0    
      1    'Helmut'    2    
      2    'Gertrud'   8    
      3    'John'      14
  </code></pre>
  
  <p>Now, how do I find the index of such combo box item if I know just the object value ? Is there a function like <code>GetItemByObject('8')</code> which could give me index 2 ?</p>