2

I cannot remove dynamically added buttons using this code in Firemonkey while in windows i successfully remove.

while GridPanelLayout7.ControlCount > 0 do
   GridPanelLayout7.Controls[0].Free;

My question is why does this work on 32 bit Windows, but does not work on Android platform?

The procedure for adding dynamic button is:

     btn := TButton.Create(nil);
     btn.Parent := GridPanelLayout7;
     btn.Align  := TAlignLayout.Client;
     btn.Text   := 'example';
     btn.TextSettings.WordWrap :=true;
     btn.OnClick := Btn_Click;

I also tried to add this code but it is same:

    for I := 0 to GridPanelLayout7.ControlsCount - 1 do
    begin
     GridPanelLayout7.Controls[0].Free;
    end;
Jande
  • 1,695
  • 2
  • 20
  • 32

0 Answers0