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

📄 basedialog.pas

📁 一套融入了系统营销管理思想的管理软件产品
💻 PAS
字号:
unit BaseDialog;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  Db, DBTables, StdCtrls, Buttons, DBCtrls, Mask;

type
  TfmBaseDialog = class(TForm)
    qyTemp: TQuery;
    bnOK: TBitBtn;
    bnCancel: TBitBtn;
    procedure FormKeyPress(Sender: TObject; var Key: Char);
    procedure FormKeyDown(Sender: TObject; var Key: Word;
      Shift: TShiftState);
    procedure bnOKClick(Sender: TObject);
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
    procedure PrepareDlg; virtual;
  end;

var
  fmBaseDialog: TfmBaseDialog;

implementation

uses Main, Loading, DataModule;

{$R *.DFM}

procedure TfmBaseDialog.FormKeyPress(Sender: TObject; var Key: Char);
begin
  if Key <> #13 then Exit;
  //当Enter按下时, 模拟Tab键, 移动光标到下一个可停驻的对象
  key := #0;
  Perform(WM_NextDlgCtl, 0, 0);
end;

procedure TfmBaseDialog.FormKeyDown(Sender: TObject; var Key: Word;
  Shift: TShiftState);
begin
  //F12按下, 关闭本窗口
  if Key = VK_F12 then
    Close;
end;

procedure TfmBaseDialog.PrepareDlg;
begin
 
end;

procedure TfmBaseDialog.bnOKClick(Sender: TObject);
begin
  if DM.tbInput.State  = dsBrowse then
    DM.tbInput.Edit;
  //将使用者的输入条件储存, 但是没更新到数据库
  DM.tbInput.Post;
end;

procedure TfmBaseDialog.FormCreate(Sender: TObject);
begin
  try
    fmLoading := TfmLoading.Create(Application);
    fmLoading.Show;
    fmLoading.Update;
    //tbInput为浏览模式时, 要变更为修改模式,
    //这样才能修改tbInput的内容
    if DM.tbInput.State = dsBrowse then
      DM.tbInput.Edit;
    
    PrepareDlg;
  finally
    fmLoading.Free;
  end;
end;

end.

⌨️ 快捷键说明

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