ringtime.pas

来自「上传个考勤系统,希望别人也能用.该代码只能算初级的东东,软件代码复用性不高,重复」· PAS 代码 · 共 63 行

PAS
63
字号
unit RingTime;

interface

uses
  Windows, SysUtils, Classes, Graphics, Controls, Forms,
  StdCtrls, Mask, ComCtrls, PrjConst;

type
  TdlgRingTime = class(TForm)
    Label4: TLabel;
    meDuration: TMaskEdit;
    edRingTime: TDateTimePicker;
    Label1: TLabel;
    btnOK: TButton;
    btnCancel: TButton;
    UpDown1: TUpDown;
    procedure FormCreate(Sender: TObject);
    procedure meDurationExit(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
    function Execute: Boolean;
  end;

var
  dlgRingTime: TdlgRingTime;

implementation

{$R *.DFM}
function TdlgRingTime.Execute: Boolean;
begin
  if not Assigned(dlgRingTime) then
    dlgRingTime:=TdlgRingTime.Create(Application);
  with dlgRingTime do
  begin
    Result:=dlgRingTime.ShowModal=mrOK;
  end;
end;

procedure TdlgRingTime.FormCreate(Sender: TObject);
begin
  edRingTime.Time:=Time;
end;

procedure TdlgRingTime.meDurationExit(Sender: TObject);
var
  nInt: Integer;
begin
  try
    nInt:=StrToInt(meDuration.Text);
    if nInt<1 then
      Raise Exception.Create(SOGEAAUIAa);
  except
    if meDuration.Canfocus then meDuration.SetFocus;
    Raise;
  end;
end;

end.

⌨️ 快捷键说明

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