Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Object-Pascal / Delphi-Language (https://www.delphipraxis.net/32-object-pascal-delphi-language/)
-   -   Delphi FindComponent,LoadFromFile ,Problem mit Dateinamen (https://www.delphipraxis.net/51542-findcomponent-loadfromfile-problem-mit-dateinamen.html)

Hallo_Thomas 14. Aug 2005 17:09


FindComponent,LoadFromFile ,Problem mit Dateinamen
 
Hallo, ich hab folgendes Problem,
ich habe zu jedem Image eine Datei,
Delphi-Quellcode:
'\Buttonunten\'+(itag)+'.bmp');
wo ich dachte ich kann sie so aufrufen. Was mache ich hier verkehrt?



Delphi-Quellcode:
itag := IntToStr((Sender as TImage).Tag);
(FindComponent('Image'+(itag)) as TImage).Picture.LoadFromFile(ExtractFilePath(ParamStr(0)) + '\Buttonunten\'+(itag)+'.bmp');

SirThornberry 14. Aug 2005 17:12

Re: FindComponent,LoadFromFile ,Problem mit Dateinamen
 
kommt eine Fehlermeldung? Zudem liefert "ExtractFilePath" den Path mit abschließendem "\" zurück.
Dementsprechend sollte es mindestens so aussehen
Delphi-Quellcode:
ExtractFilePath(ParamStr(0)) + 'Buttonunten\'+(itag)+'.bmp'
Willst du eigentlich das Bild in das Sender-Image laden? Wenn ja kannst du dir das FindComponent auch spaaren.

Hallo_Thomas 14. Aug 2005 17:20

Re: FindComponent,LoadFromFile ,Problem mit Dateinamen
 
Ok, ich danke Dir,war ein Dummer fehler von mir, dass mit dem Findcompnent werdch mir mal zu herzen nehmen


Alle Zeitangaben in WEZ +1. Es ist jetzt 07:20 Uhr.

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