VB小定时关机很好写的,不用什么api就可以啊!但是不知道这是不是你要的,如果不满意百度HI联系我啊!我再给你修改!
'代码开始,复制下面运行即可!
_____________________________________________________________________
Private Sub Command1_Click()
End
End Sub
Private Sub Command2_Click()
Dim a As Date
Dim b As Date
Dim c As String
If Text1Text <> "" Then
a = Text1Text
c = Len(a)
b = IsDate(a)
Exit Sub
End If
If Option1Value = True Then
Shell "shutdown -s -t & a"
Exit Sub
End If
If Option2Value = True Then
Shell "shutdown -r -t & a "
Exit Sub
End If
End Sub
Private Sub Form_Load()
MsgBox "请输入自定义关机时间然后确定!时间格式为hh:mm:ss", 64, "提示"
Form1Caption = "自定义关机程序"
Label1Caption = "关机"
Label2Caption = "重启"
Command1Caption = "退出"
Label3Caption = "请输入自定义时间"
Text1Text = ""
Text1ToolTipText = "请以12:00:00这样的时间格式输入"
Command2Caption = "确定"
Command2Default = True
Command1Cancel = True
End Sub
Private Sub Option1_Click()
Option1Value = True
End Sub
Private Sub Option2_Click()
Option2Value = True
End Sub
Dim a As Double
Dim b As Double
Private Sub Command1_Click()
a = Text1Text
b = 2 Sqr(((05 a) ^ 2) 2 / 3)
Text2Text = b
End Sub
Private Sub Form_Load()
Text1Text = ""
Text2Text = ""
End Sub
貌似这么着就可以,其实就是一个公式。。。俩框是textbox,一个command按钮,名字都是默认的,完全不值100分~
Dim sec, min, h
Private Sub Command1_Click()
Timer1Enabled = True
h = Text1Text
min = Text2Text
sec = Text3Text
Timer2Enabled = False
End Sub
Private Sub Command2_Click()
End
End Sub
Private Sub Form_Load()
Form1BackColor = &HFFFF00
Timer1Enabled = False
Timer1Interval = 1000
Timer2Enabled = True
Timer2Interval = 1000
Text1Text = 2
Text2Text = "00"
Text3Text = "00"
Command2Caption = "退出"
Command1Caption = "开始倒计时"
End Sub
Private Sub Timer1_Timer()
If sec > 0 Then
sec = sec - 1
Else:
If (min > 0 Or h > 0) Then
sec = 59
End If
If min > 0 Then
min = min - 1
Else:
If h > 0 Then
min = 59
End If
If h > 0 Then
h = h - 1
Else: Timer1Enabled = False
CreateObject("SAPISpVoice")Speak "GAME OVER!"
Form1BackColor = &HFF
End If
End If
End If
Text1Text = h
Text2Text = min
Text3Text = sec
Label6Caption = Now
End Sub
Private Sub Timer2_Timer()
Label6Caption = Now
End Sub
以上就是关于vb编程时用的程序全部的内容,包括:vb编程时用的程序、求一个简单VB代码程序、如何使用VB编写一个简单的小程序等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)