Registriert seit: 27. Aug 2003
Ort: Ennepetal
440 Beiträge
Delphi 2005 Personal
|
Re: OnClick zur Runtime zuweisen
4. Okt 2007, 23:19
Okay überredet. Es funktioniert:
Delphi-Quellcode:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
procedure ClickCustom(Sender:TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.ClickCustom(Sender: TObject);
begin
ShowMessage(' Test');
end;
procedure TForm1.Button1Click(Sender: TObject);
var A: Array of TButton;
i: integer;
begin
SetLength(A,200);
for i := 0 to Length(A)-1 do
begin
A[i] := TButton.Create(self);
A[i].parent := Self;
A[i].Top := i*3;
A[i].Left := i*3;
A[i].OnClick := clickcustom;
A[i].Visible := true;
end;
end;
end.
|
|
Zitat
|