Home > Software engineering >  VB to design about 15 minutes to remind timer control in advance to do
VB to design about 15 minutes to remind timer control in advance to do

Time:11-19

VB ticketing system in passenger car company made a timer for 15 minutes before the departure to remind how to do, have a special trains table businfo, one of the attributes is the departure time

CodePudding user response:

Get start time.
Use timer control + datediff;

CodePudding user response:

reference 1st floor milaoshu1020 response:
get departure time;
Use timer control + datediff;

Can you speak a little bit in detail? The best type of code, I just learn, is a small white

CodePudding user response:

Write well, code is as follows:
 
Option Explicit

Private datStartTime As Date

Private Sub Form_Load ()
'datStartTime=rs (" Starttime ")
DatStartTime=DateAdd (" n ", 16, Now) 'actual use to using annotations in the above statement, this statement is only for testing;
Timer1. Interval=60000
Timer1. Enabled=True
End Sub

Private Sub Timer1_Timer ()
If DateDiff (" n ", Now, datStartTime)=15 Then
MsgBox "ready to go." & amp; VbCrLf & amp; _
"The current time:" & amp; Now & amp; VbCrLf & amp; _
"The time of departure:" & amp; DatStartTime, vbInformation
End the If
End Sub

Run the example:

Download address:
Link: https://pan.baidu.com/s/1GlF1EEVhgX19x9uU3h3pqg
The extracted code: mrx0
  • Related