uAttemper.pas
上传用户:yjb1804
上传日期:2021-01-30
资源大小:3105k
文件大小:1k
- unit uAttemper;
- interface
- uses
- Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
- Dialogs, StdCtrls, Menus, cxLookAndFeelPainters, cxButtons,
- RzLabel, cxLabel, cxSpinEdit, cxTimeEdit, cxTextEdit,
- cxMaskEdit, cxDropDownEdit, cxCalendar, cxControls, cxContainer, cxEdit,
- cxGroupBox;
- type
- TfrmAttemper = class(TForm)
- btn1: TcxButton;
- btn2: TcxButton;
- cxgrpbx1: TcxGroupBox;
- RzLabel1: TRzLabel;
- edDate: TcxDateEdit;
- edTime: TcxTimeEdit;
- cxLabel1: TcxLabel;
- procedure FormCreate(Sender: TObject);
- procedure btn1Click(Sender: TObject);
- procedure btn2Click(Sender: TObject);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
- var
- frmAttemper: TfrmAttemper;
- implementation
- {$R *.dfm}
- uses DateUtils, uCommon;
- procedure TfrmAttemper.FormCreate(Sender: TObject);
- begin
- edDate.Date:=Date;
- edTime.Time:=Time;
- end;
- procedure TfrmAttemper.btn1Click(Sender: TObject);
- var
- dt:TDateTime;
- begin
- dt:=dateof(edDate.Date)+timeof(edTime.Time);
- if dt<Now then
- MsgBoxError('不能迟于当前时间,请重新设置时间日期。')
- else
- ModalResult:=mrOk;
- end;
- procedure TfrmAttemper.btn2Click(Sender: TObject);
- begin
- ModalResult:=mrCancel;
- end;
- end.