Einzelnen Beitrag anzeigen

Klaus01

Registriert seit: 30. Nov 2005
Ort: München
5.755 Beiträge
 
Delphi 10.4 Sydney
 
#9

Re: Array im Prozedurnamen ansprechen

  Alt 6. Jul 2009, 22:02
.. Du hast zwar nicht danach gefragt, ich habe aber trotzdem
etwas korregiert.

Delphi-Quellcode:
procedure TForm3.FormActivate(Sender: TObject);
begin
  ini:=TIniFile.create(ExtractFilePath(ParamStr(0))+'einstellungen.ini');
  try
    JPEG:=TJpegImage.Create; // JPEG erzeugen
    //BMP:=TBitmap.Create; // BMP erzeugen
    JPEG.LoadFromFile(ExtractFilePath(ParamStr(0))+'Bilder\'+ini.ReadString('Profil','Thema','Standard')+'\main.jpg');
    //BMP.Assign(JPEG);
    Image1.Picture.Bitmap.assign(JPEG); // sollte auch so funktionieren.
    Image1.SendToBack;
  finally
    ini.free;
    JPEG.free; // freigeben nicht vergessen
  end;

  SetLength(ArrayExist, maxKarten);
  SetLength(ArrayBild, maxKarten);
  SetLength(ArrayBildx, maxKarten);
  SetLength(ArrayBildy, maxKarten);

  DefineKarte;
end;
.. aber warum im onActivate Event und nicht im OnCreate?

Aus der Hilfe:
Zitat:
property OnActivate: TNotifyEvent;

Description

Use OnActivate to perform special processing when the form receives focus. A form becomes active when focus is transferred to it (when the user clicks on the form, for example).

Note: The OnActivate event of the application (TApplication), not the form, occurs when Windows switches control from another application.
Grüße
Klaus
Klaus
  Mit Zitat antworten Zitat