Delphi Popup Selection dialog box Select Directory | Selectdirectory function

Source: Internet
Author: User

Lets the user select a directory by displaying a dialog box.
Note: To add a description that contains Filectrl to the uses statement before use.
The function prototypes are as follows:
function selectdirectory (const caption:string; const root:widestring;
Out directory:string): Boolean; overload;
function Selectdirectory (var directory:string; options:tselectdiropts;
Helpctx:longint): Boolean; overload;
For the 1th overloaded function, the parameter caption is the caption of the dialog box, the parameter root specifies a directory for the initial directory to browse, and the selected directory is saved in the parameter directory.
For the 2nd overloaded function, the directory specified in the parameters directory is the directory selected when the dialog box is displayed, and the last user-selected directory is also saved in the parameter directory; The options are a collection of settings items, and if empty, the user can only select the existing directory through the dialog box. , no edit box is provided to the user to enter a new directory name. The tselectdiropts type is defined as follows:
Type
Tselectdiropt = (sdallowcreate, sdperformcreate, sdprompt);
Tselectdiropts = set of tselectdiropt;
The meanings of the specific values are as follows.
The sdallowcreate dialog box has an edit component that allows the user to enter a new directory name. But if you want to create a new directory, programmers must write their own code to create a new directory based on the obtained files.
The sdperformcreate dialog box has an edit component that allows the user to enter a directory name that does not exist, and the dialog box will select the directory and create it.
The sdprompt dialog box has an edit component that, if the user enters a directory name that does not exist, displays an informational dialog box that prompts you to create a new directory. If the Sdallowcreate setting is selected at the same time, the programmer must write the code to create a new directory based on the obtained file.

Usage:

Procedure Tform1.button1click (Sender:tobject);
Var
ss:string;
Begin
Selectdirectory (' Testdialog ', ' SSS ', Ss,[sdnewfolder, Sdshowedit, Sdshowshares, Sdnewui]);

End

Delphi Popup Selection dialog box Select Directory | selectdirectory function (GO)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.