【delphi开源代码栏目提醒】:本文主要为网学会员提供FileListOpenUnit.pas,希望对需要FileListOpenUnit.pas网友有所帮助,学习一下!
unit FileListOpenUnit;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ComCtrls, ShellCtrls, Buttons;
type
TFileListOpenForm = class(TForm)
SpeedButton2: TSpeedButton;
ShellTreeView1: TShellTreeView;
OKSpeedButton: TSpeedButton;
procedure ShellTreeView1DblClick(Sender: TObject);
procedure OKSpeedButtonClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
FileListOpenForm: TFileListOpenForm;
implementation
uses FileListUnit, DataUnit, MainUnit;
{$R *.dfm}
procedure TFileListOpenForm.ShellTreeView1DblClick(Sender: TObject);
var
i,sd:integer;
str:string;
begin
for i:=0 to ShellTreeView1.Items.Count do
if ShellTreeView1.Items[i].Selected then
begin
sd:=i;break;
end;
str:=ShellTreeView1.Items[sd].Text;
if (str='我的电脑')or(str='网上邻居')or(str='回收站')then
begin
OKSpeedButton.Enabled:=False;
end else begin
OKSpeedButton.Enabled:=True;
FileListForm.FileListBox1.Directory:=ShellTreeView1.Path;
DataUnit.FilePas:=ShellTreeView1.Path;
end;
end;
procedure TFileListOpenForm.OKSpeedButtonClick(Sender: TObject);
begin
DataUnit.FilePas:=ShellTreeView1.Path;
FileListOpenForm.Visible:=False;
end;
end.