Autor Beitrag
110022
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 287

XP SP2
Delphi 7
BeitragVerfasst: Mo 31.12.07 16:31 
Was soll hier dran falsch sein?
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
var
  Child: TForm;
begin
  { Neues untergeordnetes MDI-Fenster erzeugen }
  Child := TForm.Create(Application);
  Child.Caption := Name;
  if FileExists(Name) then Child.memo1.Lines.LoadFromFile(Name);


der kann das memo1 nicht finden obwohl es auf der form2 ist.
was ist falsch?
jakobwenzel
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1889
Erhaltene Danke: 1

XP home, ubuntu
BDS 2006 Prof
BeitragVerfasst: Mo 31.12.07 16:37 
Nein, Child ist ein TForm ohne irgendwas drauf.

_________________
I thought what I'd do was, I'd pretend I was one of those deaf-mutes.
Xentar
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2077
Erhaltene Danke: 2

Win XP
Delphi 5 Ent., Delphi 2007 Prof
BeitragVerfasst: Mo 31.12.07 17:32 
Zum besseren Verständnis:
TForm ist ein leeres Formular.
Was du brauchst, ist eine Instanz deiner Klasse, also z.B. TMeinTollesForm oder wie auch immer du das genannt hast.