Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Dynamisches erstellen von Label, Edits und Comboboxen in Delphi 5.0

Empfohlene Antworten

Hy Jungs und Mädels. Ich habe da mal ne Frage. Mache gerade ein Programm. Welches je nach Auswahl einer Combobox mehrere Objekte (label, Edit, Comboboxen) dynamisch erstellt.

Vom Prinzip her so.

Tabsheet "Kanal 1"--> Wähle welchen Kanaltyp

Wenn Kanaltyp 'X' dann erstelle

1= Combobox;

2=Editfeld;

3= Label;

Wenn Kanaltyp 'Y' dann erstelle

1= Editfeld;

2= Combobox;

3=Label;

usw....

So. Das klappt auch wunderbar. Nur habe ich mehrere Kanäle zur Auswahl (Kanal 1-8) D.h. Ich muss acht mal alles Dynamisch erstellen. Wobei jeder Kanal einzeln und verschieden einstellbar sein muss.

Jetzt könnte ich dass natürlich mit Copy-->Paste machen. nur dann habe ich am Ende nen Superlangen Quellcode.

Und den wollen wir ja vermeiden! Nicht war?

Ich habe da son ne Idee mit Parent aber weiß nicht genau wie ich das umsetzen soll. Kann mir da jemand helfen?

Poste hier mal den Teil wo ich etwas dynamisch erstelle.

Danke schon mal im voraus.

for i:=0 to 2 do begin

COMBO:=TCombobox.create(Self);

LABEL_EDIT:=TLabel.create(self);

with COMBO do begin

Parent := Form1.Panel4; //<--- Hier muss es doch sicherlich eine Möglichkeit geben, ohne jedesmal diesen Code neu aufzurufen.

Top := 50+(i*24);

Left := 120;

Width := 100;

Height := 21;

end;

with LABEL_EDIT do begin

Parent := Form1.Panel4;

Top := 53+(i*24);

Left := 20;

Width := 100;

Height := 21;

end;

if i =0 then begin

LABEL_EDIT.caption:='SIGNAL';

COMBO.Items.Add('NOR');

COMBO.Items.Add('INV');

end;

end;

Viel Spaß hiermit

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Konto

Navigation

Suchen

Suchen

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.