请问哪里有“浏览目录对话狂“控件下啊? ???告诉我地址啊》 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 Delphi 自己就有一个函数可以实现:SelectDirectory 在FileCtrl单元。从帮助中也可以找到它。————————————————————————————————————宠辱不惊,看庭前花开花落,去留无意;毁誉由人,望天上云卷云舒,聚散任风。———————————————————————————————————— 例如: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;————————————————————————————————————宠辱不惊,看庭前花开花落,去留无意;毁誉由人,望天上云卷云舒,聚散任风。———————————————————————————————————— var Dir: String;begin SelectDirectory('Select a directory', '', Dir);end;返回的Dir就是你选择的目录 unit SeleDirectory;interfaceuses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, FileCtrl;type TfrmSeleDirectory = class(TForm) DriveComboBox1: TDriveComboBox; DirectoryListBox1: TDirectoryListBox; FileListBox1: TFileListBox; FilterComboBox1: TFilterComboBox; Label1: TLabel; Label2: TLabel; Label3: TLabel; Label4: TLabel; SeleDirectoryLabel: TLabel; btnOK: TButton; btnCancel: TButton; procedure btnOKClick(Sender: TObject); procedure FormCreate(Sender: TObject); procedure DriveComboBox1Change(Sender: TObject); private { Private declarations } procedure FindException(Sender: TObject; E: Exception); public { Public declarations } end;var frmSeleDirectory: TfrmSeleDirectory; DriveChar : Char; implementation{$R *.DFM}procedure TfrmSeleDirectory.FindException(Sender: TObject; E: Exception);begin Application.MessageBox('磁盘驱动器读取错误。', '错误', MB_IconStop); DriveComboBox1.Drive := DriveChar;end;procedure TfrmSeleDirectory.btnOKClick(Sender: TObject);begin if (FileListBox1.Items.Count = 0) or (FilterComboBox1.ItemIndex = 1) then SeleDirectoryLabel.Caption := ''; Close;end;procedure TfrmSeleDirectory.FormCreate(Sender: TObject);begin Application.OnException := FindException; DriveComboBox1.Drive := 'C';end;procedure TfrmSeleDirectory.DriveComboBox1Change(Sender: TObject);begin DriveChar := DriveComboBox1.Drive;end;end. BORLAND C++中如何支持对.asm文件的编译?? 如何知道一个控件在哪个标签下可以找到? ADO方式下,怎样在一个数据库里查找一个字段是否与edit1.text值相等?如何返回具体个数? (在线等待..初程问题..)我编程时遇到几个问题,希望大家帮忙! 关于real类型的计算 菜鸟初哥求高手指点!!!!!!!!!!!!!!!! 关于qq中发送聊天内容的屏蔽字 怎么让tedit中默认为货币样式 Delphi 7 窗体创建问题 各位Delphi高手,我的分好多,因为是银行系统,请进。。。 简单的多个小问题?散分(50分) 我自己写了一个函数,我还是第一次写函数,各位高手请指教!
SelectDirectory
在FileCtrl单元。从帮助中也可以找到它。————————————————————————————————————
宠辱不惊,看庭前花开花落,去留无意;毁誉由人,望天上云卷云舒,聚散任风。
————————————————————————————————————
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;————————————————————————————————————
宠辱不惊,看庭前花开花落,去留无意;毁誉由人,望天上云卷云舒,聚散任风。
————————————————————————————————————
Dir: String;
begin
SelectDirectory('Select a directory', '', Dir);
end;返回的Dir就是你选择的目录
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, FileCtrl;type
TfrmSeleDirectory = class(TForm)
DriveComboBox1: TDriveComboBox;
DirectoryListBox1: TDirectoryListBox;
FileListBox1: TFileListBox;
FilterComboBox1: TFilterComboBox;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
SeleDirectoryLabel: TLabel;
btnOK: TButton;
btnCancel: TButton;
procedure btnOKClick(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure DriveComboBox1Change(Sender: TObject);
private
{ Private declarations }
procedure FindException(Sender: TObject; E: Exception);
public
{ Public declarations }
end;var
frmSeleDirectory: TfrmSeleDirectory;
DriveChar : Char;
implementation{$R *.DFM}procedure TfrmSeleDirectory.FindException(Sender: TObject; E: Exception);
begin
Application.MessageBox('磁盘驱动器读取错误。', '错误', MB_IconStop);
DriveComboBox1.Drive := DriveChar;
end;procedure TfrmSeleDirectory.btnOKClick(Sender: TObject);
begin
if (FileListBox1.Items.Count = 0) or (FilterComboBox1.ItemIndex = 1) then
SeleDirectoryLabel.Caption := '';
Close;
end;procedure TfrmSeleDirectory.FormCreate(Sender: TObject);
begin
Application.OnException := FindException;
DriveComboBox1.Drive := 'C';
end;procedure TfrmSeleDirectory.DriveComboBox1Change(Sender: TObject);
begin
DriveChar := DriveComboBox1.Drive;
end;end.