define the class type as follow... assuming that you are going to pass in a generic TFrame.
type TFrameClass=class of TFrame;
procedure TForm1.CreateSomething(FrameClass: TFrameClass; const Caption: String);
var
F: TFrame;
begin
F := FrameClass.Create(Self);
F.Label1.Caption := Caption;
end;
...
...
begin
CreateSomething(TMyFrame, 'Test);
end.
Subscribe to:
Post Comments (Atom)

No comments:
Post a Comment