mydialogu.pas

来自「《delphi深度编程及其项目开发》」· PAS 代码 · 共 51 行

PAS
51
字号
unit MyDialogU;

interface

uses
  Windows, Messages, SysUtils, Classes,forms;

type
  TMyDialog = class(TComponent)
  private
  FDirectoryName : String;
    { Private declarations }
  protected
    { Protected declarations }
  public
    Function Execute : boolean;
    { Public declarations }
  published
  property DirectoryName : string read FDirectoryName write FDirectoryName;
    { Published declarations }
  end;

procedure Register;

implementation

uses MyDialogFrm;

procedure Register;
begin
  RegisterComponents('Samples', [TMyDialog]);
end;


Function TMyDialog.Execute : Boolean;
begin
  with TfrmDialog.create(Application) do
  begin
    try
      showmodal;
      result := Flag;
      If Flag then
        FDirectoryName := DirectoryListBox.Directory ;
    finally
      free;
    end;
  end;
end;
end.

⌨️ 快捷键说明

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