苦苦等待
解决方案 »
- 关于提问一个CreateMutex线程操作的问题
- 如何得到数据库中图片文件的高度和宽度
- 请问用delphi有什么方法可以做一个像windows录音机一样的小程序
- 初学者,数据库问题????请帮助!
- 如何做一个能屏蔽/开放指定tcp端口的简单防火墙?
- 数据库的完整性问题
- 已经有一个Form_A,怎样动态生成一个继承Form_A的Form_B窗口?并为Form_B上的BUTTON1的Onclick事件赋值给一个已经存在的过程Procedure xx
- DBGridEH 的非常棘手的问题!!!
- 如何连接ACcess数据库 而不用odbc。
- 我想读出某string的最后几个字,如,我想读出IP:61.136.123.12第三个句号之后的内容(例子中为12),请问怎么做?我的意思是是怎样才能
- 如何在RichEdit有输入焦点的时候,插入文本进去,而保证滚动条不会滚到最后。
- 松子,快来接分!非常感谢。
function SelectDirectory(var Directory: string; Options: TSelectDirOpts; HelpCtx: Longint): Boolean; overload;
var
s :string;
begin
if SelectDirectory('Select Directory', '', S) then
ShowMessage(s);
end;
function SelectDirectory(var Directory: string; Options: TSelectDirOpts; HelpCtx: Longint): Boolean; overload;C++ syntax:extern PACKAGE bool __fastcall SelectDirectory(const AnsiString Caption, const WideString Root, AnsiString &Directory);
extern PACKAGE bool __fastcall SelectDirectory(AnsiString &Directory, TSelectDirOpts Options, int HelpCtx);DescriptionCall SelectDirectory to let the user enter a directory name. Use the first syntax to display the Windows directory browser. The Caption parameter specifies a caption for the dialog. The Root parameter specifies the root directory from which to browse. The selected directory is returned as the Directory parameter. When using this syntax, SelectDirectory does not change the value of the current directory.Warning: You can抰 use the same variable for the Root parameter and the Directory parameter.Use the second syntax to call the Select Directory dialog box. The directory passed to the function with the Directory parameter appears as the currently selected directory when the dialog box appears. The name of the directory the user selects becomes the value of Directory when the function returns.The HelpCtx parameter is the help context ID number.The Options parameter is a set of values. If Options is the empty set, the user can only select a directory that already exists. No edit box is provided for the user to enter a new directory name. If Options is not empty, the included values determine how the dialog responds when the user types a nonexistent directory name.With either syntax, SelectDirectory returns true if the user selected a directory and chose OK, and false if the user chose Cancel or closed the dialog box without selecting a directory.
Demo===========
uses FileCtrl;const
SELDIRHELP = 1000;
procedure TForm1.Button1Click(Sender: TObject);
var
Dir: string;
begin
Dir := 'C:\MYDIR';
if SelectDirectory(Dir, [sdAllowCreate, sdPerformCreate, sdPrompt],SELDIRHELP) then
Label1.Caption := Dir;
end;
2.自己编写一个界面不就得了 其实很简单 使用DirectroyListBox控件 设置它的相关属性就OK了