OpenDialog.Filter := 'Text and Word files only|*.txt *.doc' Ībove we have allowed two different file types, separated by a. After the separator, you define a mask that selects the files you want. The drop down dialog shows the description before the | separator. OpenDialog.Filter := 'Text files only|*.txt' The following example selects for text files only: The filter text is displayed in a drop down below the file name field. This allows only certain file types to be displayed and selectable. When returning from the dialog, if the user has hit OK, this property will contain the (first) selected file name, including its full path (see the first example). (Otherwise, the file name field is blank). Note that the dialog must have an anchor - here we provide the current object - self - as the anchor.īefore displaying the dialog, you are likely to configure it to your needs by setting the dialog properties. You define a TOpenDialog variable, and then assign a new TOpenDialog object to it: When using it, you would proceed along the following steps: The topendialog can be configured to suit your needs. It can be defined by dragging the open dialog icon from the Dialogs tab in Delphi, or by defining a TOpenDialog variable. It is used to allow a user to select one or more files to open. Delphi Basics : topendialog command Delphi Basics
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |