Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Sonstige Fragen zu Delphi (https://www.delphipraxis.net/19-sonstige-fragen-zu-delphi/)
-   -   Delphi Kein Zugriff auf Public eines Frames (https://www.delphipraxis.net/100455-kein-zugriff-auf-public-eines-frames.html)

Nils_13 28. Sep 2007 14:53


Kein Zugriff auf Public eines Frames
 
Hi,

wenn ich Init Aufrufe, habe ich darauf trotz des Publiceintrags des Frames keinen Zugriff drauf (Undefinierter Bezeichner: 'Init'). Woran könnte das liegen ?

Delphi-Quellcode:
  TfrmExp = class(TFrame)
    ...
  private
    { Private-Deklarationen }
    ...
  public
    { Public-Deklarationen }
    ...
    procedure Init;
  end;
Delphi-Quellcode:
var frm : TForm;
    exp : TFrame;
begin
  frm := TForm.Create(Self);
  with frm do
  begin
    exp := TfrmExp.Create(frm);
    with exp do
    begin
-->  Init;  <--
      Parent := frm;
      Align := alClient;
      Show;
    end;
    Height := 515;
    Width := 515;
    Show;
  end;

s-off 28. Sep 2007 14:58

Re: Kein Zugriff auf Public eines Frames
 
Hallo,

Delphi-Quellcode:
var frm : TForm;
    exp : TFrame;
begin
  frm := TForm.Create(Self);
  with frm do
  begin
    exp := TfrmExp.Create(frm);
TFrame <> TfrmExp.Create(frm);

Schreibst Du also

Delphi-Quellcode:
var frm : TForm;
    exp : TfrmExp;
gehts

phXql 28. Sep 2007 15:05

Re: Kein Zugriff auf Public eines Frames
 
Weil nur der Inhalt der Variable ein TfrmExp ist, der Typ ist aber ein TFrame.

Nils_13 28. Sep 2007 16:41

Re: Kein Zugriff auf Public eines Frames
 
Logisch, muss man aber auch erst drauf kommen, danke.


Alle Zeitangaben in WEZ +1. Es ist jetzt 19:21 Uhr.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz