Thema: Delphi Konzeptfrage FormCreate

Einzelnen Beitrag anzeigen

nahpets
(Gast)

n/a Beiträge
 
#6

Re: Konzeptfrage FormCreate

  Alt 12. Mai 2009, 08:54
Hallo,

Form1 ist ja auch vom Type TForm1 und nicht vom Type TForm, Du benötigst hier also noch einen entsprechenden Typecast. Ob das so in der von Dir gewünschten Form geht, weiß ich nicht.

Eventuell könnte ja sowas in dieser Art funktionieren (nicht getestet)
Delphi-Quellcode:
function createform(AOwner: TFormClass ; var nform {typloser Parameter} ):boolean;
Begin
  result := false;
  try
    if nForm is TForm then begin
      application.CreateForm(AOwner,nform);
      nform.Parent := mainform.panel_df;
      mainform.Notebook1.Visible := false;
      nform.Show;
      result := true;
    end;
  except
  end;
end;
  Mit Zitat antworten Zitat