Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   GUI-Design mit VCL / FireMonkey / Common Controls (https://www.delphipraxis.net/18-gui-design-mit-vcl-firemonkey-common-controls/)
-   -   Delphi RadioButtons dynamisch erzeugen -kein OnResize mehr im Form? (https://www.delphipraxis.net/31157-radiobuttons-dynamisch-erzeugen-kein-onresize-mehr-im-form.html)

alcaeus 5. Okt 2004 10:54


RadioButtons dynamisch erzeugen -kein OnResize mehr im Form?
 
Hi!

Ich erzeuge im OnCreate eines Forms eine Anzahl von RadioButtons dynamisch:
Delphi-Quellcode:
  SetLength(RadioButtons, Length(CryptingComponentsNames));
  iMaxWidth := 0;
  for i := 0 to Length(CryptingComponentsNames)-1 do
  begin
    RadioButtons[i] := TRadioButton.Create(self);
    with RadioButtons[i] do
    begin
      Left := 8;
      Top := 8+i*24;
      Width := 153;
      Height := 17;
      AutoSize := True;
      Caption := CryptingComponentsNames[TCryptingComponents(i)];
      Parent := self;
    end;
    iMaxWidth := Max(iMaxWidth, RadioButtons[i].Width);
  end;
  Self.ClientWidth := iMaxWidth+16;
  Self.ClientHeight := 41+Length(CryptingComponentsNames)*24;
RadioButtons ist definiert als array of TRadioButton (wer hätte das gedacht :zwinker:)
TCryptingComponents ist ein Typ, in welchem alle Verfahren aufgelistet werden.
CryptingComponentsNames ist definiert als array[TCryptingComponents] of String;

Num zum Problem: das Formular reagiert nicht mehr auf OnResize. Lasse ich die for-Schleife hingegen weg, funktioniert alles. Klicks auf Komponenten usw. funktionieren, also verfängt sich die Schleife nicht irgendwo.
Kann mir irgendjemand weiterhelfen?

Greetz
alcaeus


Alle Zeitangaben in WEZ +1. Es ist jetzt 00:02 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