sjcustomfrm.pas

来自「供水营销打印程序源码」· PAS 代码 · 共 71 行

PAS
71
字号
unit SJCustomFrm;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, SJChildFrm, ShellApi, PropStorageEh;

type
  TSJCustomForm = class(TSJChildForm)
    PropStorage: TPropStorageEh;
    RegPropManager: TRegPropStorageManEh;
    procedure FormKeyPress(Sender: TObject; var Key: Char);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    procedure FormShow(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  SJCustomForm: TSJCustomForm;

implementation

uses SJInvPrintGlobal;

{$R *.dfm}

procedure TSJCustomForm.FormKeyPress(Sender: TObject; var Key: Char);
begin
  inherited;
  if GUseDOSEnterKey and (Key = #13) then
    Perform(CM_DIALOGKEY, VK_TAB, 0)
  else if Key = 'VK_F1' then
    begin if FileExists(GsysPath + 'help\' + Caption + '.htm') then
      ShellExecute(Handle, Pchar('Open'), Pchar(GsysPath + 'help\' + Caption + '.htm'),
        nil, nil, SW_SHOWNORMAL);
    end;
end;

procedure TSJCustomForm.FormClose(Sender: TObject;
  var Action: TCloseAction);
begin
  inherited;
  if PropStorage.Active then
  try
    RegPropManager.Path := Format(GREGUserSetting, [GUserName]) + '\Forms';
    PropStorage.Section := Caption;
    PropStorage.SaveProperties;
  except
    ;
  end;
end;

procedure TSJCustomForm.FormShow(Sender: TObject);
begin
  inherited;
  if PropStorage.Active then
  try
    RegPropManager.Path := Format(GREGUserSetting, [GUserName]) + '\Forms';
    PropStorage.Section        := Caption;
    PropStorage.LoadProperties;
  except
    ;
  end;
end;

end.

⌨️ 快捷键说明

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