saveasfrm.pas

来自「考勤管理是企业内部管理的重要环节和基础」· PAS 代码 · 共 57 行

PAS
57
字号
unit SaveAsFrm;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  SDIfrm, ExtCtrls, StdCtrls, Buttons, DBCtrls;

resourcestring
  sGoodsCode='货品编号不能为空!';
  sGoodsName='货品名称不能为空!';
  sWareName='材料名称不能为空!';

type
  TSaveAsForm = class(TSDIForm)
    Label1: TLabel;
    Label2: TLabel;
    Label4: TLabel;
    edtGoodsID: TEdit;
    edtWareName: TEdit;
    edtName: TEdit;
    BitBtn1: TBitBtn;
    BitBtn2: TBitBtn;
    procedure BitBtn1Enter(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  SaveAsForm: TSaveAsForm;

implementation

{$R *.DFM}

procedure TSaveAsForm.BitBtn1Enter(Sender: TObject);
begin
  inherited;
  if Trim(edtGoodsID.Text)='' then begin
    ShowMessage(Pchar(sGoodsCode));
    edtGoodsID.SetFocus;
    abort;
  end else if Trim(edtName.Text)='' then begin
    ShowMessage(Pchar(sGoodsName));
    edtName.SetFocus;
    abort;
  end else if Trim(edtWareName.Text)='' then begin
    ShowMessage(Pchar(sWareName));
    edtWareName.SetFocus;
    abort;
  end;
end;

end.

⌨️ 快捷键说明

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