Einzelnen Beitrag anzeigen

Benutzerbild von qb-tim
qb-tim

Registriert seit: 3. Mär 2006
Ort: Deutschland
280 Beiträge
 
Delphi 6 Professional
 
#1

OnChange für OnActivate erstellte Komponenten

  Alt 18. Mai 2007, 14:09
Hi,

ich habe in meiner TForm2.OnActivate Prozedur mehrere TEdit Komponenten erstellen lassen und möchte für alle eine OnChange Prozedur erstellen. Wie macht man das?

Delphi-Quellcode:

...

var
  Form2: TForm2;
  Edit: Array[1..9, 1..9] of TEdit;
  x, y, i: Integer;

...

procedure TForm2.FormActivate(Sender: TObject);
begin
  for y := 1 to 9 do
    for x := 1 to 9 do
    begin
      Edit[x, y] := TEdit.Create(Self);
      Edit[x, y].Parent := Form2;
      Edit[x, y].Width := 25;
      Edit[x, y].Text := '';
      Edit[x, y].Top := 56 + ( y * 21 ) - 21 + ( StrToInt ( FloatToStr( Int( y / 3.3 ) ) ) * 5 );
      Edit[x, y].Left := 8 + ( x * 25 ) - 25 + ( StrToInt ( FloatToStr( Int( x / 3.3 ) ) ) * 5 );
      
      ...

    end;

  ...

end;

...
PS: Meine Edits werden als 9 x 9 Feld erstellt
  Mit Zitat antworten Zitat