www.pudn.com > 自动计划(autoplan)源代码___强烈推荐 .rar > Unt_alarm.pas


unit Unt_alarm; 
 
interface 
 
uses 
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, 
  Dialogs, StdCtrls, ComCtrls; 
 
type 
  TFrm_Alarm = class(TForm) 
    GroupBox1: TGroupBox; 
    DateTimePicker1: TDateTimePicker; 
    Button1: TButton; 
    Button2: TButton; 
    procedure Button1Click(Sender: TObject); 
    procedure Button2Click(Sender: TObject); 
  private 
    { Private declarations } 
  public 
    { Public declarations } 
  end; 
 
var 
  Frm_Alarm: TFrm_Alarm; 
 
implementation 
 
uses Unt_Main; 
 
{$R *.dfm} 
 
procedure TFrm_Alarm.Button1Click(Sender: TObject); 
begin 
  if StrToTime(FormatDateTime('hh:mm:ss',DateTimePicker1.Time)) < time then 
     Application.MessageBox('您设置的提醒时间已经过了','提示',mb_ok+MB_ICONINFORMATION) 
  else 
  begin 
    Auto_Plan.vstr_alarmTime := StrToTime(FormatDateTime('hh:mm:ss',DateTimePicker1.Time)); 
    Auto_Plan.TimeRing.Enabled := true; 
    Auto_Plan.SkinRing.Hint := FormatDateTime('hh:mm:ss',DateTimePicker1.Time); 
    close; 
  end; 
end; 
 
procedure TFrm_Alarm.Button2Click(Sender: TObject); 
begin 
  close; 
end; 
 
end.