Thema: Delphi Öfnnen einer Datei

Einzelnen Beitrag anzeigen

Benutzerbild von alcaeus
alcaeus

Registriert seit: 11. Aug 2003
Ort: München
6.537 Beiträge
 
#7

Re: Öfnnen einer Datei

  Alt 10. Nov 2004, 14:42
Hi Chucky_88,

nichts gefunden?

[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
Andreas B.
Die Mutter der Dummen ist immer schwanger.
Ein Portal für Informatik-Studenten: www.infler.de
  Mit Zitat antworten Zitat