AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein GUI-Design mit VCL / FireMonkey / Common Controls Delphi Komponente zur laufzeit erzeugen Komp-liste anzeigen lassen
Thema durchsuchen
Ansicht
Themen-Optionen

Komponente zur laufzeit erzeugen Komp-liste anzeigen lassen

Ein Thema von mentos112 · begonnen am 1. Sep 2009 · letzter Beitrag vom 1. Sep 2009
 
mentos112

Registriert seit: 2. Mär 2005
21 Beiträge
 
#1

Komponente zur laufzeit erzeugen Komp-liste anzeigen lassen

  Alt 1. Sep 2009, 17:44
Moin Leute,

habe wiedermal ein Problem vor mir liegen wo ich nicht weiter komme! Hoffe sehr das Ihr mir bei der Lösung dieses Problems helft!

Ich erzeuge zur Laufzeit von einen Formular auf einem anderen Komponenten. klappt soweit alles ganz gut, bis auf die tatsache, dass die erzeugten komponenten nicht in der Komponentenliste des 2.Formulars stehen. geb euch mal kurzen quellauszug

1. Formular
Delphi-Quellcode:
procedure TForm1.button1Click(Sender: TObject);
var LEdit: TLabeledEdit;
      g_box: TGroupBox;
      radio: TRadioGroup;
      datum: TDateTimePicker;
      name: TLabel;
      button: TButton;
      i: integer;
begin

for i:=1 to 3 do begin

   Form6.Width := i*270+(i*10)+20;
   Form6.Height := 580;
   Form6.Position := poScreenCenter;

   g_box := TGroupBox.Create(Self);
   with g_box do
      begin
         Name := 'g_box_' + IntToStr(i);
         Caption := 'test ' + IntToStr(i);
         Parent := Form6;
         Height := 190;
         Width := 270;
         Left := (i-1)*280+10;
         Top := 10;
         ComponentIndex := 3+i;
      end;

   radio := TRadioGroup.Create(Self);
   with radio do
      begin
         Parent := g_box;
         Columns := 2;
         Items.Add('ware1');
         Items.Add('ware2');
         Height := 33;
         Width := 249;
         Left := 10;
         Top := 15;
      end;

   LEdit := TLabeledEdit.Create(Self);
   with LEdit do
      begin
         Name := 'W_Nr_' + IntToStr(i);
         EditLabel.Caption := 'Warennummer';
         Text := '';
         Parent := g_box;
         Width := 121;
         Top := 68;
         Left := 10;
      end;

   LEdit := TLabeledEdit.Create(Self);
   with LEdit do
      begin
         Name := 'Wert_' + IntToStr(i);
         EditLabel.Caption := 'Wert';
         Text := '';
         Parent := g_box;
         Width := 249;
         Top := 112;
         Left := 10;
      end;

   LEdit := TLabeledEdit.Create(Self);
   with LEdit do
      begin
         Name := 'Anzahl_' + IntToStr(i);
         EditLabel.Caption := 'Anzahl';
         Text := '';
         Parent := g_box;
         Width := 121;
         Top := 156;
         Left := 10;
      end;

   datum := TDateTimePicker.Create(Self);
   with datum do
      begin
         Name := 'datum_' + IntToStr(i);
         Parent := g_box;
         Width := 121;
         Top := 68;
         Left := 138;
      end;

   name := TLabel.Create(Self);
   with name do
      begin
         Name := 'label_' + IntToStr(i);
         Caption := 'Datum';
         Parent := g_box;
         Width := 121;
         Top := 52;
         Left := 138;
      end;

   button := TButton.Create(Self);
   with button do
      begin
         Name := 'lbutton_' + IntToStr(i);
         Caption := 'Laden';
         Parent := g_box;
         Width := 121;
         Top := 156;
         Left := 138;
      end;
end;

   button := TButton.Create(Self);
   with button do
      begin
         Name := 'sbutton';
         Caption := 'Speichern';
         Parent := Form6;
         Width := 81;
         Top := 210;
         Left := Form6.Width-273;
      end;

   button := TButton.Create(Self);
   with button do
      begin
         Name := 'dbutton';
         Caption := 'Drucken';
         Parent := Form6;
         Width := 81;
         Top := 210;
         Left := Form6.Width-187;
      end;

   button := TButton.Create(Self);
   with button do
      begin
         Name := 'bbutton';
         Caption := 'Schließen';
         Parent := Form6;
         Width := 81;
         Top := 210;
         Left := Form6.Width-101;
      end;

   Form6.ShowModal();
end;
2.Formular
Delphi-Quellcode:
procedure TForm6.Button1Click(Sender: TObject);
var i: Integer;
begin
   Memo1.Lines.Clear;
   for i:= 0 to ComponentCount-1 do
   begin
      Memo1.Lines.Add(Components[i].name);
   end;
end;
Bekomme aber in dem Memo nur die Komponenten "MEMO" und "BUTTON" angezeigt, welche aber schon zur entwicklung erzeugt wurden!

Bitte um Eure Hilfe

Mit freundlichen Grüßen

mentos112
  Mit Zitat antworten Zitat
 


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 06:53 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz