Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Cross-Platform-Entwicklung (https://www.delphipraxis.net/91-cross-platform-entwicklung/)
-   -   Delphi [android] resize component runtime (https://www.delphipraxis.net/202158-%5Bandroid%5D-resize-component-runtime.html)

danten 3. Okt 2019 14:32

[android] resize component runtime
 
Hi, I need to resize all TRectangle in TFlowLayout on android.
It doesn't work for me.

Delphi-Quellcode:
procedure TfrmMain.FormResize(Sender: TObject);
var
  i: integer;
begin
  FlowLayout1.BeginUpdate;
  for I := 0 to FlowLayout1.ComponentCount -1 do
  begin
    if Components[i] is TRectangle then
    begin
      TRectangle(Components[i]).BeginUpdate;
      TRectangle(Components[i]).Width := (FlowLayout1.Width / 3) -10;
      TRectangle(Components[i]).EndUpdate;
    end;
  end;
  FlowLayout1.EndUpdate;
end;
Thank you

TurboMagic 3. Okt 2019 18:35

AW: [android] resize component runtime
 
Two things:

1. What does happen for you? "It doesn't work" is a bit generic as a "failure message"
2. You are sure you want to öpost in English in the German branch of Delphipraxiy?

Regards
TurboMagic

danten 3. Okt 2019 19:00

AW: [android] resize component runtime
 
Zitat:

Zitat von TurboMagic (Beitrag 1448993)
Two things:

1. What does happen for you? "It doesn't work" is a bit generic as a "failure message"
2. You are sure you want to öpost in English in the German branch of Delphipraxiy?

Regards
TurboMagic

And you program in German or English?
I'm not German or American.
Delphipraxis is a good forum, only some users can not advise, but only spam.
I've already advised someone on the forum and I expect someone to advise me too!


Delphi-Quellcode:
var
  i: integer;
  Item : TControl;
begin

    for I := FlowLayout1.ControlsCount -1 downto 0 do
    begin
      Item := FlowLayout1.Controls[i];
      Item.Width := (FlowLayout1.Width / 3) -10;
      Item.Height := Item.Width;
    end;

tggmx 3. Okt 2019 19:04

AW: [android] resize component runtime
 
If you change your for loop from
Delphi-Quellcode:
FlowLayout1.ComponentCount
to
Delphi-Quellcode:
FlowLayout1.ControlsCount
then it should work.

QuickAndDirty 4. Okt 2019 10:48

AW: [android] resize component runtime
 
Zitat:

Zitat von tggmx (Beitrag 1448997)
If you change your for loop from
Delphi-Quellcode:
FlowLayout1.ComponentCount
to
Delphi-Quellcode:
FlowLayout1.ControlsCount
then it should work.

I support this .

Rollo62 4. Okt 2019 16:49

AW: [android] resize component runtime
 
Sometimes UI changes not always trigger a repaint for me.
An explicit .Repaint; might help to clarify.

TurboMagic 5. Okt 2019 17:08

AW: [android] resize component runtime
 
Zitat:

Zitat von danten (Beitrag 1448996)
And you program in German or English?
I'm not German or American.
Delphipraxis is a good forum, only some users can not advise, but only spam.
I've already advised someone on the forum and I expect someone to advise me too!

I program in Delphi ;-)
And I usually do advise. But since there is an English speaking Delphipraxis
branch available I see not much reason to post in English in the German one.

I'm quite sure you would have gotten similar advice as you got here over there.
There's simply no use having German forums when everybody starts talking in English
there even when English ones do exist!


Alle Zeitangaben in WEZ +1. Es ist jetzt 09:46 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz