Delete/add item in RadioGroup

Posted in Components

Use Delete and Add procedures of the RadioGroup.Items for removing and adding item. If you want add item in RadioGroup to a defined place, then use Exchange procedure after Add procedure.

procedure TForm1.Button1Click(Sender: TObject);
begin
  RadioGroup1.Items.Delete(2);
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
  with RadioGroup1 do
  begin
    Items.Add('  New'+IntToStr(Items.Count-2));
    Items.Exchange(2, Items.Count-1);
  end;
end;