title: Remove selected component from combobox DELPHI
body: <p>I have ComboBox4,ComboBox1 and Button5
  When I click Button5 program should remove component selected in combobox4 from the ComboBox4 and ComboBox1 components' list. But I get list out of bounds error with the following code...</p>
  
  <pre><code>procedure TForm1.Button5Click(Sender: TObject);
  var
  cat : Integer;
  trinti: TComponent;
  catT : String;
  begin
  catT := ComboBox4.Text;
  cat := ComboBox4.Items.IndexOf(catT);
  trinti := ComboBox4.Components[cat];
  
  ComboBox1.Items.BeginUpdate;
  ComboBox4.Items.BeginUpdate;
    ComboBox4.RemoveComponent(trinti);
    ComboBox1.RemoveComponent(trinti);
  ComboBox1.Items.EndUpdate;
  ComboBox4.Items.EndUpdate;
  
  removeCat(catT);
  end;
  </code></pre>
  
  <p>Please help :(</p>