Einzelnen Beitrag anzeigen

Benutzerbild von Bernhard Geyer
Bernhard Geyer

Registriert seit: 13. Aug 2002
17.171 Beiträge
 
Delphi 10.4 Sydney
 
#3

AW: Komponenten zur Laufzeit oder Entwicklungszeit

  Alt 30. Jan 2011, 10:01
Folgende Idee:

Delphi-Quellcode:
type
  TSystemzustand = (Zustand1=1, Zustand2=23, ... Zustandz);

type
  TmeinForm = class(TForm);
  var
    zustandEdits: array[Low(TSystemZustand)..High(TSystemzustand)];
  ...

procedure TMeinForm.FormCreate()
  for i := Low(TSystemZustand) to High(TSystemzustand) do
  begin
    zustandEdits[i] := TEdit.Create(self);
    ...
  end;
end;

procedure TMeinForm.DoWithEdit(zustand: TSystemzustand);
begin
   zustandEdits[zustand].Text := 'text';
end;
Windows Vista - Eine neue Erfahrung in Fehlern.
  Mit Zitat antworten Zitat