模拟电子钟 带语音报时功能
EWX_SHUTDOWN 关闭系统 dwReserved Long,保留,设为零
这个函数调用后会立刻返回,系统关闭过程是在后台进行的。注意先中止自己的应用程序,使关闭过程更显平顺。当然,您的进程必须有足够的优先权,否则也不能执行这种操作.
下图为我们对程序界面的修改.其中我们主要添加了一个frame1 ,两个单选框( Option1和Option2 ) , 三个文本框( text1 , text2 , text3 ) , 三个标签( label1 , label2 , label3 ) 以及一个按钮Command1.其中两个单选框( Option1和Option2 ) ,可以通过选择其中的一个,来确定究竟要使用那种功能. 三个文本框( text1 , text2 , text3 )来接受设定的时间,之后点击按钮Command1来应用。
下面是添加和修改的代码:
‘ = = = = = = = = = = = = = = = = = = = = ‘下面的为新添加的
‘ = = = = = = = = = = = = = = = = = = = = Dim guanji As Boolean Dim sheshi As Integer
Dim shefen As Integer Dim shemiao As Integer
Private Sub Command1 _ Click ( )
If Text1.Text = "" Or Text2.Text = "" Or Text3.Text Then MsgBox "请填完整" End If
If Option1.Value = True Then guanji = True end if
sheshi = Text1.Text shefen = Text2.Text
shemiao = Text3.Text End Sub
‘ = = = = = = = = = = = = = = = = = = = = = = ‘ 下面语句中,添加了一部分,有标示 ‘ = = = = = = = = = = = = = = = = = = = = = = Private Sub Timer1 _ Timer ( ) miao = Second (time) miao = 60 – miao fen = Minute (time)
fen = 60 - fen shi = Hour (time)
If shi > = 12 Then ‘因为一天之内时针要走二十四个钟头,也就是要走两圈,所以将下午和