⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 infoselefilefrm.pas

📁 一个电力企业的后台管理程序
💻 PAS
字号:
unit InfoSeleFileFrm;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  ComCtrls, Db, DBTables, StdCtrls, FileCtrl, ShellApi;

type
  TForm_InfoSeleFile = class(TForm)
    ListBox1: TTreeView;
    procedure ListBox1DblClick(Sender: TObject);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
    APath:string;
  end;

var
  Form_InfoSeleFile: TForm_InfoSeleFile;

implementation
uses systemDM,CounselingFrm, ManagData,ConDef,AskInfoForm;
{$R *.DFM}

procedure TForm_InfoSeleFile.ListBox1DblClick(Sender: TObject);
var
 TempForm:TFrm_AskInfo;
begin

  TempForm := Self.Owner As TFrm_AskInfo;

  if listbox1.Items.Count>0 then
  begin
   TempForm.Edt_FileName.Text := Trim(listbox1.Selected.Text);
   { if not (ManagDM.Tbl_counseling.State in [dsEdit,dsInsert]) then ManagDM.Tbl_counseling.edit;
    ManagDM.Tbl_counseling.fieldbyname('InfoFile').AsString:=trim(listbox1.Selected.Text);}

  end;
  close;
end;

procedure TForm_InfoSeleFile.FormClose(Sender: TObject;
  var Action: TCloseAction);
begin
  Action:=Cafree;
  Form_InfoSeleFile:=nil;
end;

procedure TForm_InfoSeleFile.FormCreate(Sender: TObject);
var
  FSearchRec:TSearchRec;
  FindResult:integer;
  TempForm: TFrm_AskInfo;
  PathStr : String;
begin
  ListBox1.Items.Clear;
  TempForm := Self.Owner as TFrm_AskInfo;
  PathStr := StringReplace(TempForm.Cb_FilePath.Text,':','',[rfReplaceAll]);
  APath:='\\'+ TempForm.Cb_HostName.Text +'\'+ PathStr +'\*.*';
  if (pos(':',APath)>0) or (pos(':',APath)>0) then
    APath:=StrReplace(APath,':','');

  FindResult:=FindFirst(APath,faDirectory,FSearchRec);
  try
    while FindResult=0 do
    begin
      ListBox1.Items.Add(nil,FSearchRec.Name);
      FindResult:=FindNext(FSearchRec);
    end;
  finally
    FindClose(FSearchRec);
  end;
end;

end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -