æ°å»ºä¸ä¸ªçªä½FROM1 åä¸ä¸ª æé® Command1
æ·»å ä¸ä¸ª Timer1 æ§ä»¶ å两个 Label(å计æ¶Xå°æ¶Xåéï¼ï¼æ¾ç¤ºå½åæ¶é´ï¼
Text1.Text(å°æ¶)Text2.Text(å)Text3ï¼ç§ï¼
..............å¼ å¿æ¨ï¼.代ç ............................
Dim t$
Private Sub Command1_Click()
't为设置çè¦å ³æºçæ¶å»
t = Text1 & ":" & Text2 & ":" & Text3
'å¯å¨Timeræ§ä»¶ï¼å¼å§å计æ¶
Timer1.Enabled = True
End Sub
Private Sub Form_Load()
'设置Timeræ§ä»¶çæ¶é´é´é为1ç§
Timer1.Interval = 1000
'èµ·å¨ç¨åºæ¶ï¼è®¡æ¶å¨ä¸å¯ç¨
Timer1.Enabled = False
End Sub
Private Sub Timer1_Timer()
'å计æ¶ï¼è®¾ç½®æ¶é´ä¸å½åæ¶é´çå·®
timeLabel = Format(CDate(t) - Time, "hh:mm:ss")
'æ¾ç¤ºå½åç³»ç»æ¶é´
nowLabel = Time
'å¦ææ¶é´å·®ä¸º0ï¼å°±ç«å»å ³æºï¼ï¼ï¼
If timeLabel = "00:00:00" Then Shell "shutdown -S -t 0"
End Sub
........å¼ å¿æ¨ï¼ææå¾ç.............
Option Explicit
Dim a$
Private Sub Command1_Click()
a = Text1.Text & ":" & Text2.Text & ":" & Text3.Text
Timer2.Enabled = True
Label5.Caption = a
End Sub
Private Sub Command2_Click()
Timer2.Enabled = False
End Sub
Private Sub Timer1_Timer()
Label1.Caption = Time
End Sub
Private Sub Timer2_Timer()
If a = Label1.Caption Then Shell "shutdown -S -t 0"
End Sub