Einzelnen Beitrag anzeigen

TRBB

Registriert seit: 31. Okt 2007
18 Beiträge
 
Delphi 7 Professional
 
#10

Re: Aus Frame heraus auf übergeordnete (haupt)Form zugreifen

  Alt 1. Nov 2007, 09:47
Delphi-Quellcode:
var
  parentForm: TComponent;
begin
  parentForm := FrameForm.Parent;
  while not (parentForm is TMainForm) do
    parentForm := (parentForm as TForm).Parent;
  (parentForm as TForm).caption := 'test erfolgreich';
und auch
ValidParentForm(FrameForm).caption := 'test erfolgreich'; Funktionieren beide nicht.
Das Problem ist das VerleihForm durch Delphi beim erstellen eines Frames nicht automatisch erstellt wird.
Bei normalen Forms findet man oben im interface Teil
Delphi-Quellcode:
var
  MeinForm: TMeinForm;
Bei Frames aber nicht.
Ich habe nun einfach beim Frame
Delphi-Quellcode:
var
  FrameForm: TFrameForm;
eingefügt aber das scheint nicht ganz richtig zu sein.

Beide Versionen produzieren Fehler.
  Mit Zitat antworten Zitat