Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Object-Pascal / Delphi-Language (https://www.delphipraxis.net/32-object-pascal-delphi-language/)
-   -   Delphi Öfnnen einer Datei (https://www.delphipraxis.net/33638-oefnnen-einer-datei.html)

Chucky_88 10. Nov 2004 14:29


Öfnnen einer Datei
 
Hallo,
hab mal wieder ne Frage.
Ich bin derzeit dabei ein Proramm zu absteln. Sollte klar sein =)
Es ist eine art Wecker. Ich geb ne Zeit ein Drück auf start und der Weckt mich dann. Er macht dies mit einem wav File das er abspielt. Nun die Frage: Ich habe vor ein 'Datei Öffnen' Feld zu basteln. ZB wie in Word das man seine Word Datei findet und öffnen kann. Datei -> Öfnnen ...
Wie mach ich das?
Gibt es außerdem eine Möglichkeit mp3's in einem Delphi Programm ab zu spielen ?

Thx Chucky

alcaeus 10. Nov 2004 14:32

Re: Öfnnen einer Datei
 
Hi Chucky_88,

zum ersten: Delphi-Referenz durchsuchenTOpenDialog bzw. [dp]"TOpenDialog"[/dp].
zum zweiten: Delphi-Referenz durchsuchenTMediaPlayer bzw. [dp]"TMediaPlayer"[/dp] oder [dp]"bass.dll"[/dp]

Greetz
alcaeus

Chucky_88 10. Nov 2004 14:33

Re: Öfnnen einer Datei
 
Fettes Merci

Chucky_88 10. Nov 2004 14:38

Re: Öfnnen einer Datei
 
Wobei ich dazu nichts finde :-/ TOpenDialog

Bowler 10. Nov 2004 14:40

Re: Öfnnen einer Datei
 
Ein kleiner Tipp:
Ziehe dir die Komponente (findest du im Reiter "Dialoge") auf das Formular, und schaue dir dann die Funktion TOpenDialog.Execute an und die Eigenschaft TOpenDialog.Filename.

damit solltest du schonmal die grundlegende Funktionsweise dieser Komponente nachvollziehen können.

Gruß
Christian

Ultimator 10. Nov 2004 14:41

Re: Öfnnen einer Datei
 
Mit OpenDialog.Filename erhältst du z.B. schon mal den Dateinamen der gewählten Datei. Die OH hätte dir auch hier geholfen ;-)

alcaeus 10. Nov 2004 14:42

Re: Öfnnen einer Datei
 
Hi Chucky_88,

nichts gefunden? :roll:

[equote="Die Delphi-OH zum Thema 'Verwendung des TOpenDialogs'"]One of the commonly used dialog box components is TOpenDialog. This component is usually invoked by a New or Open menu item under the File option on the main menu bar of a form. The dialog box contains controls that let you select groups of files using a wildcard character and navigate through directories.

The TOpenDialog component makes an Open dialog box available to your application. The purpose of this dialog box is to let a user specify a file to open. You use the Execute method to display the dialog box.

When the user chooses OK in the dialog box, the user's file is stored in the TOpenDialog FileName property, which you can then process as you want.

The following code can be placed in an Action and linked to the Action property of a TMainMenu subitem or be placed in the subitem's OnClick event:

Code:
if OpenDialog1.Execute then
   filename := OpenDialog1.FileName;
This code will show the dialog box and if the user presses the OK button, it will copy the name of the file into a previously declared AnsiString variable named filename.[/equote]

Greetz
alcaeus


Alle Zeitangaben in WEZ +1. Es ist jetzt 00:24 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