home *** CD-ROM | disk | FTP | other *** search
- unit alrmdemo;
-
- interface
-
- uses
- SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
- Forms, Dialogs, StdCtrls, Buttons, PSalarm;
-
- type
- TDemoAlarm = class(TForm)
- BitBtn1: TBitBtn;
- Label1: TLabel;
- Edit1: TEdit;
- Label4: TLabel;
- Alarm1: TAlarm;
- procedure BitBtn1Click(Sender: TObject);
- procedure Alarm1AlarmNotify(const ATime: TDateTime);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
-
- var
- DemoAlarm: TDemoAlarm;
-
- implementation
-
- {$R *.DFM}
-
- procedure TDemoAlarm.BitBtn1Click(Sender: TObject);
- begin
- alarm1.Alarmtime := strtotime(edit1.text);
- alarm1.SetAlarm;
- end;
-
- procedure TDemoAlarm.Alarm1AlarmNotify(const ATime: TDateTime);
- begin
- showMessage('Time is up');
- end;
-
- end.
-