I'm trying to use several TSpeedButtons on a TFlowPanel to show a list of options that the user can choose. This is how I create those buttons:
procedure FillOptions(ButtonPanel: TFlowPanel; Options: TStrings; Action: TNotifyEvent);
var Option: string;
Button: TSpeedButton;
begin
for Option in Options do begin
Button:= TSpeedButton.Create(ButtonPanel);
Button.Caption := Option;
Button.Width := Canvas.TextWidth(Option) + 20;
Button.GroupIndex := 99;
Button.AllowAllUp := True;
Button.OnClick := Action;
Button.Parent := ButtonPanel;
end;
end;
The problem is that I can't get to chose more than one option. When I click a button it goes down but the button previously chosen goes up.
What am I forgetting to set so more than one button can be down at the same time ?.
Thank you.