📄 clocktime.pas
字号:
unit ClockTime;
interface
uses
Windows, SysUtils, Classes, Graphics, Controls, Forms,
StdCtrls, Mask, PrjConst;
type
TdlgClockTime = class(TForm)
meBegin: TMaskEdit;
Label1: TLabel;
Label2: TLabel;
meEnd: TMaskEdit;
btnOK: TButton;
btnCancel: TButton;
Label3: TLabel;
procedure meBeginExit(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
function Execute: Boolean;
end;
var
dlgClockTime: TdlgClockTime;
implementation
uses Main, Functions;
{$R *.DFM}
function TdlgClockTime.Execute: Boolean;
begin
if not Assigned(dlgClockTime) then
dlgClockTime:=TdlgClockTime.Create(Application);
with dlgClockTime do
begin
Result:=dlgClockTime.ShowModal=mrOK;
end;
end;
procedure TdlgClockTime.meBeginExit(Sender: TObject);
begin
with Sender as TCustomEdit do
begin
try
if MyStrToTime(Text)>1 then
Raise Exception.Create(SEANEOyENEIHhMmO);
except
if CanFocus then SetFocus;
Raise;
end;
end;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -