AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein Cross-Platform-Entwicklung Delphi [android] resize component runtime

[android] resize component runtime

Ein Thema von danten · begonnen am 3. Okt 2019 · letzter Beitrag vom 5. Okt 2019
Antwort Antwort
danten

Registriert seit: 19. Feb 2012
Ort: Czech Republic, Prag
126 Beiträge
 
Delphi 10.1 Berlin Architect
 
#1

[android] resize component runtime

  Alt 3. Okt 2019, 15:32
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
Daniel
  Mit Zitat antworten Zitat
TurboMagic

Registriert seit: 28. Feb 2016
Ort: Nordost Baden-Württemberg
2.772 Beiträge
 
Delphi 12 Athens
 
#2

AW: [android] resize component runtime

  Alt 3. Okt 2019, 19:35
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
  Mit Zitat antworten Zitat
danten

Registriert seit: 19. Feb 2012
Ort: Czech Republic, Prag
126 Beiträge
 
Delphi 10.1 Berlin Architect
 
#3

AW: [android] resize component runtime

  Alt 3. Okt 2019, 20:00
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;
Daniel
  Mit Zitat antworten Zitat
tggmx

Registriert seit: 29. Okt 2006
33 Beiträge
 
Delphi 10.4 Sydney
 
#4

AW: [android] resize component runtime

  Alt 3. Okt 2019, 20:04
If you change your for loop from FlowLayout1.ComponentCount to FlowLayout1.ControlsCount then it should work.
  Mit Zitat antworten Zitat
QuickAndDirty

Registriert seit: 13. Jan 2004
Ort: Hamm(Westf)
1.882 Beiträge
 
Delphi 12 Athens
 
#5

AW: [android] resize component runtime

  Alt 4. Okt 2019, 11:48
If you change your for loop from FlowLayout1.ComponentCount to FlowLayout1.ControlsCount then it should work.
I support this .
Andreas
Monads? Wtf are Monads?
  Mit Zitat antworten Zitat
Rollo62

Registriert seit: 15. Mär 2007
3.882 Beiträge
 
Delphi 12 Athens
 
#6

AW: [android] resize component runtime

  Alt 4. Okt 2019, 17:49
Sometimes UI changes not always trigger a repaint for me.
An explicit .Repaint; might help to clarify.
  Mit Zitat antworten Zitat
TurboMagic

Registriert seit: 28. Feb 2016
Ort: Nordost Baden-Württemberg
2.772 Beiträge
 
Delphi 12 Athens
 
#7

AW: [android] resize component runtime

  Alt 5. Okt 2019, 18:08
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!
  Mit Zitat antworten Zitat
Themen-Optionen Thema durchsuchen
Thema durchsuchen:

Erweiterte Suche
Ansicht

Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 10:15 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