Home > Back-end >  Delphi to set the date/time automatically when the reminder
Delphi to set the date/time automatically when the reminder

Time:09-26

If I set a date/time to remind of time, such as: 10:00 this time is set for the 2015-06-16 time, if time is equal to the time when the system is out of reminding window, could you tell me how to implement the warrior, I am using Delphi is essentially, thank you!
Note: regardless of my current on the form, it is time to remind, if each form should write the timer events

CodePudding user response:

Put the main form.

CodePudding user response:

Main form put a timer

Procedure TForm2. Timer1Timer (Sender: TObject);
Var
Dt: TDateTime;
The begin
Dt:=StrToDateTime (' 10:00:00 2015-06-16 ');
If (now () & gt;=(dt) and (now () & lt; Dt + 1/24/60) then//in a minute. Of course you can only use now ()=(dt) to judge, this is your timer interval must be less than or equal to 1000
The begin
Timer1. Enabled:=false;
//execution remind
end;
end;

CodePudding user response:

Generally in the main window, put a Timer control, don't set, the Timer control is independent thread, war with CPU time,
All the time, can be in this Timer, judgment,

Code needs to optimize upstairs, because the Timer is 1 seconds interval judgment, a minute, you can have the chance to 60 times,

CodePudding user response:

Actually the basic press lyhoo163 said, full of trouble occupy system performance, but this really don't need to seriously consider demand
  • Related