Registriert seit: 14. Aug 2004
1.439 Beiträge
Delphi 2007 Professional
|
Re: Methoden während der Laufzeit erstellter Objekte
15. Jan 2005, 12:29
Delphi-Quellcode:
type
TForm1= class(TForm)
public
procedure ShapeClick(Sender:TObject);
procedure Bauen;
end;
....
procedure TForm1.ShapeClick(Sender:TObject);
begin
end;
....
procedure TForm1.Bauen;
var i,x:integer;
begin
Spalten:= Spinedit2.value;
Reihen:= Spinedit1.value;
for x:= 1 to Reihen do begin
for i:=1 to Spalten do begin
MyShape[i] := TMyShape.Create(Form1);
with MyShape[i] do begin
Parent := Form1;
Height := 15;
Width := 15;
Shape:=strectangle;
Left := 120+22*i;
Top := x*22;
MyShape.OnClick:=ShapeClick;
end;
end;
end;
end;
....
[/quote]
Gruss Hans
2B or not 2B, that is FF
|